From 818a07a64ae05e45b25cd75b41539fef082000f4 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Fri, 23 Apr 2010 14:14:06 -0400 Subject: [PATCH] Added more complex dot notation example (from defunkt/mustache). --- examples/dot_notation/DotNotation.php | 13 +++++++++---- examples/dot_notation/dot_notation.mustache | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/examples/dot_notation/DotNotation.php b/examples/dot_notation/DotNotation.php index d5f1dd0..0274e19 100644 --- a/examples/dot_notation/DotNotation.php +++ b/examples/dot_notation/DotNotation.php @@ -2,13 +2,18 @@ /** * DotNotation example class. Uses DOT_NOTATION pragma. - * + * * @extends Mustache */ class DotNotation extends Mustache { - public $foo = array( - 'bar' => array( - 'baz' => 'Qux', + public $person = array( + 'name' => array('first' => 'Chris', 'last' => 'Firescythe'), + 'age' => 24, + 'hometown' => array( + 'city' => 'Cincinnati', + 'state' => 'OH', ) ); + + public $normal = 'Normal'; } diff --git a/examples/dot_notation/dot_notation.mustache b/examples/dot_notation/dot_notation.mustache index 85873f7..12cbf7f 100644 --- a/examples/dot_notation/dot_notation.mustache +++ b/examples/dot_notation/dot_notation.mustache @@ -1 +1,6 @@ -Grandchild is "{{foo.bar.baz}}". \ No newline at end of file +* {{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}} \ No newline at end of file