Prechádzať zdrojové kódy

Added double section, escaped output, utf8 escaped and utf8 unescaped examples.

Justin Hileman 15 rokov pred
rodič
commit
1ede993bb3

+ 9 - 0
examples/double_section/DoubleSection.php

@@ -0,0 +1,9 @@
+<?php
+
+class DoubleSection extends Mustache {
+	public function t() {
+		return true;
+	}
+	
+	public $two = "second";
+}

+ 7 - 0
examples/double_section/double_section.mustache

@@ -0,0 +1,7 @@
+{{#t}}
+  * first
+{{/t}}
+* {{two}}
+{{#t}}
+  * third
+{{/t}}

+ 3 - 0
examples/double_section/double_section.txt

@@ -0,0 +1,3 @@
+* first
+* second
+* third

+ 5 - 0
examples/escaped/Escaped.php

@@ -0,0 +1,5 @@
+<?php
+
+class Escaped extends Mustache {
+	public $title = "Bear > Shark";
+}

+ 1 - 0
examples/escaped/escaped.mustache

@@ -0,0 +1 @@
+<h1>{{title}}</h1>

+ 1 - 0
examples/escaped/escaped.txt

@@ -0,0 +1 @@
+<h1>Bear &gt; Shark</h1>

+ 5 - 0
examples/utf8/UTF8.php

@@ -0,0 +1,5 @@
+<?php
+
+class UTF8Unescaped extends Mustache {
+	public $test = '中文又来啦';
+}

+ 1 - 0
examples/utf8/utf8.mustache

@@ -0,0 +1 @@
+<h1>中文 {{test}}</h1>

+ 1 - 0
examples/utf8/utf8.txt

@@ -0,0 +1 @@
+<h1>中文 中文又来啦</h1>

+ 5 - 0
examples/utf8_unescaped/UTF8Unescaped.php

@@ -0,0 +1,5 @@
+<?php
+
+class UTF8 extends Mustache {
+	public $test = '中文又来啦';
+}

+ 1 - 0
examples/utf8_unescaped/utf8_unescaped.mustache

@@ -0,0 +1 @@
+<h1>中文 {{{test}}}</h1>

+ 1 - 0
examples/utf8_unescaped/utf8_unescaped.txt

@@ -0,0 +1 @@
+<h1>中文 中文又来啦</h1>