Updated section short-circuit logic to actually run when only inverted sections exist.

This commit is contained in:
Justin Hileman
2010-04-26 23:19:20 -04:00
parent 9b8454f2ba
commit 69a514916c
4 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ class Mustache {
* @return string * @return string
*/ */
protected function renderSection($template, &$context) { protected function renderSection($template, &$context) {
if (strpos($template, $this->otag . '#') === false) { if (strpos($template, $this->otag . '#') === false && strpos($template, $this->otag . '^') === false) {
return $template; return $template;
} }
@@ -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