From 14ff48584ab77916bd23b101e51f99714eeb8d76 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 23:50:42 -0700 Subject: [PATCH] Add an example for anchored dot notation. --- .../AnchoredDotNotation.php | 55 +++++++++++++++++++ .../anchored_dot_notation.mustache | 4 ++ .../anchored_dot_notation.txt | 11 ++++ .../partials/genre.mustache | 5 ++ 4 files changed, 75 insertions(+) create mode 100644 test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php create mode 100644 test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache create mode 100644 test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt create mode 100644 test/fixtures/examples/anchored_dot_notation/partials/genre.mustache diff --git a/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php b/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php new file mode 100644 index 0000000..ee76059 --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php @@ -0,0 +1,55 @@ + 'Punk', + 'subgenres' => array( + array( + 'name' => 'Hardcore', + 'subgenres' => array( + array( + 'name' => 'First wave of black metal', + 'subgenres' => array( + array('name' => 'Norwegian black metal'), + array( + 'name' => 'Death metal', + 'subgenres' => array( + array( + 'name' => 'Swedish death metal', + 'subgenres' => array( + array('name' => 'New wave of American metal'), + ), + ), + ), + ), + ), + ), + array( + 'name' => 'Thrash metal', + 'subgenres' => array( + array('name' => 'Grindcore'), + array( + 'name' => 'Metalcore', + 'subgenres' => array( + array('name' => 'Nu metal'), + ), + ), + ), + ), + ), + ), + ), + ), + ); +} diff --git a/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache new file mode 100644 index 0000000..9494fb1 --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache @@ -0,0 +1,4 @@ +{{% ANCHORED-DOT }} +{{# genres }} +{{> genre }} +{{/ genres }} \ No newline at end of file diff --git a/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt new file mode 100644 index 0000000..fa56efc --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt @@ -0,0 +1,11 @@ + - Punk + - Hardcore + - First wave of black metal + - Norwegian black metal + - Death metal + - Swedish death metal + - New wave of American metal + - Thrash metal + - Grindcore + - Metalcore + - Nu metal diff --git a/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache b/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache new file mode 100644 index 0000000..f51c503 --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache @@ -0,0 +1,5 @@ +{{% ANCHORED-DOT }} + - {{ name }} +{{# .subgenres }} + {{> genre }} +{{/ .subgenres }} \ No newline at end of file