Added more complex dot notation example (from defunkt/mustache).
This commit is contained in:
@@ -2,13 +2,18 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DotNotation example class. Uses DOT_NOTATION pragma.
|
* DotNotation example class. Uses DOT_NOTATION pragma.
|
||||||
*
|
*
|
||||||
* @extends Mustache
|
* @extends Mustache
|
||||||
*/
|
*/
|
||||||
class DotNotation extends Mustache {
|
class DotNotation extends Mustache {
|
||||||
public $foo = array(
|
public $person = array(
|
||||||
'bar' => array(
|
'name' => array('first' => 'Chris', 'last' => 'Firescythe'),
|
||||||
'baz' => 'Qux',
|
'age' => 24,
|
||||||
|
'hometown' => array(
|
||||||
|
'city' => 'Cincinnati',
|
||||||
|
'state' => 'OH',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public $normal = 'Normal';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1,6 @@
|
|||||||
Grandchild is "{{foo.bar.baz}}".
|
* {{person.name.first}} {{person.name.last}}
|
||||||
|
* {{person.age}}
|
||||||
|
* {{person.hometown.city}}, {{person.hometown.state}}
|
||||||
|
* {{#person}}{{hometown.city}}, {{hometown.state}}{{/person}}
|
||||||
|
* {{#person}}{{#hometown}}{{city}}, {{state}}{{/hometown}}{{/person}}
|
||||||
|
* {{normal}}
|
||||||
Reference in New Issue
Block a user