Two new examples: 'delimiters' and 'sections'. Would be more exciting if 50% of new examples didn't fail :)

This commit is contained in:
Justin Hileman
2010-04-06 00:24:33 -04:00
parent cb5985171c
commit 4059c4da00
6 changed files with 49 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
class Delimiters extends Mustache {
public $start = "It worked the first time.";
public function middle() {
return array(
array('item' => "And it worked the second time."),
array('item' => "As well as the third."),
);
}
public $final = "Then, surprisingly, it worked the final time.";
}
+8
View File
@@ -0,0 +1,8 @@
{{=<% %>=}}
* <% start %>
<%=| |=%>
|# middle |
* | item |
|/ middle |
|={{ }}=|
* {{ final }}
+4
View File
@@ -0,0 +1,4 @@
* It worked the first time.
* And it worked the second time.
* As well as the third.
* Then, surprisingly, it worked the final time.
+14
View File
@@ -0,0 +1,14 @@
<?php
class Sections extends Mustache {
public $start = "It worked the first time.";
public function middle() {
return array(
array('item' => "And it worked the second time."),
array('item' => "As well as the third."),
);
}
public $final = "Then, surprisingly, it worked the final time.";
}
+5
View File
@@ -0,0 +1,5 @@
* {{ start }}
{{# middle }}
* {{ item }}
{{/ middle }}
* {{ final }}
+4
View File
@@ -0,0 +1,4 @@
* It worked the first time.
* And it worked the second time.
* As well as the third.
* Then, surprisingly, it worked the final time.