Merge branch 'dev' into feature/implicit-iterator

Conflicts:
	Mustache.php
This commit is contained in:
Justin Hileman
2010-05-23 00:15:16 -04:00
18 changed files with 469 additions and 118 deletions
+1 -1
View File
@@ -1 +1 @@
<h1>{{title}}{{! just something interesting... or not... }}</h1>
<h1>{{title}}{{! just something interesting... #or ^not... }}</h1>
@@ -0,0 +1,6 @@
<?php
class InvertedDoubleSection extends Mustache {
public $t = false;
public $two = 'second';
}
@@ -0,0 +1,7 @@
{{^t}}
* first
{{/t}}
* {{two}}
{{^t}}
* third
{{/t}}
@@ -0,0 +1,3 @@
* first
* second
* third
+13
View File
@@ -0,0 +1,13 @@
<?php
class Partials extends Mustache {
public $name = 'ilmich';
public $data = array(
array('name' => 'federica', 'age' => 27, 'gender' => 'female'),
array('name' => 'marco', 'age' => 32, 'gender' => 'male'),
);
protected $_partials = array(
'children' => "{{#data}}{{name}} - {{age}} - {{gender}}\n{{/data}}",
);
}
+2
View File
@@ -0,0 +1,2 @@
Children of {{name}}:
{{>children}}
+3
View File
@@ -0,0 +1,3 @@
Children of ilmich:
federica - 27 - female
marco - 32 - male
@@ -0,0 +1,5 @@
<?php
class PragmaUnescaped extends Mustache {
protected $vs = 'Bear > Shark';
}
@@ -0,0 +1,3 @@
{{%UNESCAPED}}
{{vs}}
{{{vs}}}
@@ -0,0 +1,2 @@
Bear > Shark
Bear &gt; Shark
+37
View File
@@ -0,0 +1,37 @@
<?php
/**
* Whitespace test for tag names.
*
* Per http://github.com/janl/mustache.js/issues/issue/34/#comment_244396
* tags should strip leading and trailing whitespace in key names.
*
* `{{> tag }}` and `{{> tag}}` and `{{>tag}}` should all be equivalent.
*
* @extends Mustache
*/
class Whitespace extends Mustache {
public $foo = 'alpha';
public $bar = 'beta';
public function baz() {
return 'gamma';
}
public function qux() {
return array(
array('key with space' => 'A'),
array('key with space' => 'B'),
array('key with space' => 'C'),
array('key with space' => 'D'),
array('key with space' => 'E'),
array('key with space' => 'F'),
array('key with space' => 'G'),
);
}
protected $_partials = array(
'alphabet' => " * {{.}}\n",
);
}
+10
View File
@@ -0,0 +1,10 @@
{{^ inverted section test }}
These are some things:
{{/inverted section test }}
* {{ foo }}
* {{ bar}}
* {{ baz }}
{{# qux }}
* {{ key with space }}
{{/ qux }}
{{#qux}}.{{/qux}}
+12
View File
@@ -0,0 +1,12 @@
These are some things:
* alpha
* beta
* gamma
* A
* B
* C
* D
* E
* F
* G
.......