mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix #75 for new inheritance system
This commit is contained in:
@@ -13,7 +13,7 @@ namespace {
|
||||
|
||||
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled', Fenom::FORCE_COMPILE);
|
||||
|
||||
$fenom->display("greeting.tpl", array(
|
||||
$fenom->display("extends/75-child.tpl", array(
|
||||
"user" => array(
|
||||
"name" => "Ivka",
|
||||
'type' => 'new'
|
||||
|
13
sandbox/templates/extends/75-child.tpl
Normal file
13
sandbox/templates/extends/75-child.tpl
Normal file
@@ -0,0 +1,13 @@
|
||||
{extends 'extends/75-parent.tpl'}
|
||||
{block 'child'}
|
||||
{macro child_test(v, i)}
|
||||
child test - {$v}, i = {$i};<br/>
|
||||
{var $i = $i -1}
|
||||
{if $i > 0}
|
||||
{macro.child_test v=$v i=$i}
|
||||
{/if}
|
||||
{/macro}
|
||||
|
||||
child call: <br/>
|
||||
{macro.child_test v = 'ok' i = 5}
|
||||
{/block}
|
12
sandbox/templates/extends/75-parent.tpl
Normal file
12
sandbox/templates/extends/75-parent.tpl
Normal file
@@ -0,0 +1,12 @@
|
||||
{macro parent_test(v, i)}
|
||||
parent test - {$v}, i = {$i};<br/>
|
||||
{var $i = $i -1}
|
||||
{if $i > 0}
|
||||
{macro.parent_test v=$v i=$i}
|
||||
{/if}
|
||||
{/macro}
|
||||
|
||||
{block 'child'}{/block}
|
||||
|
||||
parent call:<br/>
|
||||
{macro.parent_test v = 'ok' i = 5} <br/>
|
Reference in New Issue
Block a user