Add filters for templates (#30)

This commit is contained in:
bzick
2013-08-01 01:05:19 +04:00
parent e68f3dd99a
commit f1d252a3cc
4 changed files with 99 additions and 36 deletions

View File

@@ -47,7 +47,7 @@ class MacrosTest extends TestCase
$this->tpl("macro_recursive.tpl", '{macro factorial(num)}
{if $num}
{$num} {macro.factorial num=$num-1}
{$num} {macro.factorial num=$num-1} {$num}
{/if}
{/macro}
@@ -104,6 +104,6 @@ class MacrosTest extends TestCase
$this->fenom->compile('macro_recursive.tpl');
$this->fenom->flush();
$tpl = $this->fenom->getTemplate('macro_recursive.tpl');
$this->assertSame("10 9 8 7 6 5 4 3 2 1", Modifier::strip($tpl->fetch(array()), true));
$this->assertSame("10 9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10", Modifier::strip($tpl->fetch(array()), true));
}
}