From 1282b8104a61ccb6c3c783e6668d409555cf807c Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 24 Nov 2010 03:52:04 -0500 Subject: [PATCH] A broken example for issue #12 - recursive/nested sections. --- examples/sections_nested/SectionsNested.php | 33 +++++++++++++++++++ .../sections_nested/sections_nested.mustache | 7 ++++ examples/sections_nested/sections_nested.txt | 12 +++++++ 3 files changed, 52 insertions(+) create mode 100644 examples/sections_nested/SectionsNested.php create mode 100644 examples/sections_nested/sections_nested.mustache create mode 100644 examples/sections_nested/sections_nested.txt diff --git a/examples/sections_nested/SectionsNested.php b/examples/sections_nested/SectionsNested.php new file mode 100644 index 0000000..ec01b75 --- /dev/null +++ b/examples/sections_nested/SectionsNested.php @@ -0,0 +1,33 @@ + 'Von Kaiser', + 'enemies' => array( + array('name' => 'Super Macho Man'), + array('name' => 'Piston Honda'), + array('name' => 'Mr. Sandman'), + ) + ), + array( + 'name' => 'Mike Tyson', + 'enemies' => array( + array('name' => 'Soda Popinski'), + array('name' => 'King Hippo'), + array('name' => 'Great Tiger'), + array('name' => 'Glass Joe'), + ) + ), + array( + 'name' => 'Don Flamenco', + 'enemies' => array( + array('name' => 'Bald Bull'), + ) + ), + ); + } +} \ No newline at end of file diff --git a/examples/sections_nested/sections_nested.mustache b/examples/sections_nested/sections_nested.mustache new file mode 100644 index 0000000..9f8007d --- /dev/null +++ b/examples/sections_nested/sections_nested.mustache @@ -0,0 +1,7 @@ +Enemies of {{ name }}: +{{# enemies }} +{{ name }} ... who also has enemies: +{{# enemies }} +--> {{ name }} +{{/ enemies }} +{{/ enemies }} \ No newline at end of file diff --git a/examples/sections_nested/sections_nested.txt b/examples/sections_nested/sections_nested.txt new file mode 100644 index 0000000..72c44d0 --- /dev/null +++ b/examples/sections_nested/sections_nested.txt @@ -0,0 +1,12 @@ +Enemies of Little Mac: +Von Kaiser ... who also has enemies: +--> Super Macho Man +--> Piston Honda +--> Mr. Sandman +Mike Tyson ... who also has enemies: +--> Soda Popinski +--> King Hippo +--> Great Tiger +--> Glass Joe +Don Flamenco ... who also has enemies: +--> Bald Bull