|
@@ -33,6 +33,36 @@ EOS;
|
|
|
<input placeholder="ENTER YOUR NAME">
|
|
<input placeholder="ENTER YOUR NAME">
|
|
|
</fieldset>
|
|
</fieldset>
|
|
|
|
|
|
|
|
|
|
+EOS;
|
|
|
|
|
+
|
|
|
|
|
+ $m = new Mustache_Engine(array(
|
|
|
|
|
+ 'partials' => array('input' => $partial),
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ $tpl = $m->loadTemplate($src);
|
|
|
|
|
+
|
|
|
|
|
+ $data = new Mustache_Test_FiveThree_Functional_ClassWithLambda();
|
|
|
|
|
+ $this->assertEquals($expected, $tpl->render($data));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function testLambdaInterpolationsInsidePartialsAreIndentedProperly()
|
|
|
|
|
+ {
|
|
|
|
|
+ $src = <<<EOS
|
|
|
|
|
+<fieldset>
|
|
|
|
|
+ {{> input }}
|
|
|
|
|
+</fieldset>
|
|
|
|
|
+
|
|
|
|
|
+EOS;
|
|
|
|
|
+ $partial = <<<EOS
|
|
|
|
|
+<input placeholder="{{ placeholder }}">
|
|
|
|
|
+
|
|
|
|
|
+EOS;
|
|
|
|
|
+
|
|
|
|
|
+ $expected = <<<EOS
|
|
|
|
|
+<fieldset>
|
|
|
|
|
+ <input placeholder="Enter your name">
|
|
|
|
|
+</fieldset>
|
|
|
|
|
+
|
|
|
EOS;
|
|
EOS;
|
|
|
|
|
|
|
|
$m = new Mustache_Engine(array(
|
|
$m = new Mustache_Engine(array(
|
|
@@ -54,4 +84,11 @@ class Mustache_Test_FiveThree_Functional_ClassWithLambda
|
|
|
return strtoupper($val);
|
|
return strtoupper($val);
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public function placeholder()
|
|
|
|
|
+ {
|
|
|
|
|
+ return function() {
|
|
|
|
|
+ return 'Enter your name';
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|