diff --git a/examples/complex/complex.mustache b/examples/complex/complex.mustache index e7ca1b5..f3d8fea 100644 --- a/examples/complex/complex.mustache +++ b/examples/complex/complex.mustache @@ -1,16 +1,16 @@
The list is empty.
-{{/empty}} \ No newline at end of file +{{/isEmpty}} \ No newline at end of file diff --git a/examples/complex/complex.php b/examples/complex/complex.php index adc8291..ca32ed7 100644 --- a/examples/complex/complex.php +++ b/examples/complex/complex.php @@ -9,16 +9,16 @@ class Complex extends Mustache { array('name' => 'blue', 'current' => false, 'url' => '#Blue'), ); - public function link() { + public function isLink() { // Exploit the fact that the current iteration item is at the top of the context stack. - return $this->getVariable($current) != true; + return $this->getVariable('current', $this->context) != true; } - public function list() { - return !($this->empty()); + public function notEmpty() { + return !($this->isEmpty()); } - public function empty() { + public function isEmpty() { return count($this->item) === 0; } } \ No newline at end of file diff --git a/examples/complex/complex.txt b/examples/complex/complex.txt index 5504ffc..eb78d45 100644 --- a/examples/complex/complex.txt +++ b/examples/complex/complex.txt @@ -3,4 +3,4 @@