Updated section short-circuit logic to actually run when only inverted sections exist.
This commit is contained in:
+1
-1
@@ -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
|
||||||
Reference in New Issue
Block a user