Fixed complex example to use inverted sections rather than fancy ruby-ish context swizzling (which never worked in PHP anyway).
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
{{#current}}
|
||||
<li><strong>{{name}}</strong></li>
|
||||
{{/current}}
|
||||
{{#isLink}}
|
||||
{{^current}}
|
||||
<li><a href="{{url}}">{{name}}</a></li>
|
||||
{{/isLink}}
|
||||
{{/current}}
|
||||
{{/item}}
|
||||
</ul>
|
||||
{{/notEmpty}}
|
||||
|
||||
@@ -9,11 +9,6 @@ class Complex extends Mustache {
|
||||
array('name' => 'blue', 'current' => false, 'url' => '#Blue'),
|
||||
);
|
||||
|
||||
public function isLink() {
|
||||
// Exploit the fact that the current iteration item is at the top of the context stack.
|
||||
return $this->getVariable('current', $this->context) != true;
|
||||
}
|
||||
|
||||
public function notEmpty() {
|
||||
return !($this->isEmpty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user