mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add tag filter. Move benchmark to another project
This commit is contained in:
0
sandbox/compiled/.gitkeep
Normal file
0
sandbox/compiled/.gitkeep
Normal file
61
sandbox/compiled/greeting.tpl.baf47f57.10.php
Normal file
61
sandbox/compiled/greeting.tpl.baf47f57.10.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/** Fenom template 'greeting.tpl' compiled at 2013-09-02 17:37:18 */
|
||||
return new Fenom\Render($fenom, function ($tpl) {
|
||||
?>
|
||||
|
||||
A1
|
||||
<?php
|
||||
/* greeting.tpl:4: {mc.factorial num=10} */
|
||||
$_tpl4154309674_1 = $tpl->exchangeArray(array("num" => 10));
|
||||
?><?php
|
||||
/* macros.tpl:2: {if $num} */
|
||||
if($tpl["num"]) { ?>
|
||||
<?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?> <?php
|
||||
/* macros.tpl:3: {macro.factorial num=$num-1} */
|
||||
$_tpl2531688351_1 = $tpl->exchangeArray(array("num" => $tpl["num"] - 1));
|
||||
$tpl->getMacro("factorial")->__invoke($tpl);
|
||||
$tpl->exchangeArray($_tpl2531688351_1); /* X */ unset($_tpl2531688351_1); ?> <?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?>
|
||||
<?php
|
||||
/* macros.tpl:4: {/if} */
|
||||
} ?>
|
||||
<?php
|
||||
$tpl->exchangeArray($_tpl4154309674_1); /* X */ unset($_tpl4154309674_1); ?>
|
||||
A2<?php
|
||||
}, array(
|
||||
'options' => 128,
|
||||
'provider' => false,
|
||||
'name' => 'greeting.tpl',
|
||||
'base_name' => 'greeting.tpl',
|
||||
'time' => 1378125225,
|
||||
'depends' => array (
|
||||
0 =>
|
||||
array (
|
||||
'macros.tpl' => 1378129033,
|
||||
'greeting.tpl' => 1378125225,
|
||||
),
|
||||
),
|
||||
'macros' => array(
|
||||
'factorial' => function ($tpl) {
|
||||
?><?php
|
||||
/* macros.tpl:2: {if $num} */
|
||||
if($tpl["num"]) { ?>
|
||||
<?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?> <?php
|
||||
/* macros.tpl:3: {macro.factorial num=$num-1} */
|
||||
$_tpl2531688351_1 = $tpl->exchangeArray(array("num" => $tpl["num"] - 1));
|
||||
$tpl->getMacro("factorial")->__invoke($tpl);
|
||||
$tpl->exchangeArray($_tpl2531688351_1); /* X */ unset($_tpl2531688351_1); ?> <?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?>
|
||||
<?php
|
||||
/* macros.tpl:4: {/if} */
|
||||
} ?>
|
||||
<?php
|
||||
}),
|
||||
|
||||
));
|
61
sandbox/compiled/greeting.tpl.ef153838.e.php
Normal file
61
sandbox/compiled/greeting.tpl.ef153838.e.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/** Fenom template 'greeting.tpl' compiled at 2013-09-02 17:37:39 */
|
||||
return new Fenom\Render($fenom, function ($tpl) {
|
||||
?>
|
||||
|
||||
A1
|
||||
<?php
|
||||
/* greeting.tpl:4: {mc.factorial num=10} */
|
||||
$_tpl4154309674_1 = $tpl->exchangeArray(array("num" => 10));
|
||||
?><?php
|
||||
/* macros.tpl:2: {if $num} */
|
||||
if($tpl["num"]) { ?>
|
||||
<?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?> <?php
|
||||
/* macros.tpl:3: {macro.factorial num=$num-1} */
|
||||
$_tpl2531688351_1 = $tpl->exchangeArray(array("num" => $tpl["num"] - 1));
|
||||
$tpl->getMacro("factorial")->__invoke($tpl);
|
||||
$tpl->exchangeArray($_tpl2531688351_1); /* X */ unset($_tpl2531688351_1); ?> <?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?>
|
||||
<?php
|
||||
/* macros.tpl:4: {/if} */
|
||||
} ?>
|
||||
<?php
|
||||
$tpl->exchangeArray($_tpl4154309674_1); /* X */ unset($_tpl4154309674_1); ?>
|
||||
A2<?php
|
||||
}, array(
|
||||
'options' => 0,
|
||||
'provider' => false,
|
||||
'name' => 'greeting.tpl',
|
||||
'base_name' => 'greeting.tpl',
|
||||
'time' => 1378125225,
|
||||
'depends' => array (
|
||||
0 =>
|
||||
array (
|
||||
'macros.tpl' => 1378129033,
|
||||
'greeting.tpl' => 1378125225,
|
||||
),
|
||||
),
|
||||
'macros' => array(
|
||||
'factorial' => function ($tpl) {
|
||||
?><?php
|
||||
/* macros.tpl:2: {if $num} */
|
||||
if($tpl["num"]) { ?>
|
||||
<?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?> <?php
|
||||
/* macros.tpl:3: {macro.factorial num=$num-1} */
|
||||
$_tpl2531688351_1 = $tpl->exchangeArray(array("num" => $tpl["num"] - 1));
|
||||
$tpl->getMacro("factorial")->__invoke($tpl);
|
||||
$tpl->exchangeArray($_tpl2531688351_1); /* X */ unset($_tpl2531688351_1); ?> <?php
|
||||
/* macros.tpl:3: {$num} */
|
||||
echo $tpl["num"]; ?>
|
||||
<?php
|
||||
/* macros.tpl:4: {/if} */
|
||||
} ?>
|
||||
<?php
|
||||
}),
|
||||
|
||||
));
|
13
sandbox/fenom.php
Normal file
13
sandbox/fenom.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/../../vendor/autoload.php';
|
||||
|
||||
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled', 0);
|
||||
|
||||
$fenom->display("greeting.tpl", array(
|
||||
"user" => array(
|
||||
"name" => "Ivka",
|
||||
'type' => 'new'
|
||||
),
|
||||
'type' => 'new'
|
||||
));
|
5
sandbox/templates/greeting.tpl
Normal file
5
sandbox/templates/greeting.tpl
Normal file
@ -0,0 +1,5 @@
|
||||
{import 'macros.tpl' as mc}
|
||||
|
||||
A1
|
||||
{mc.factorial num=10}
|
||||
A2
|
5
sandbox/templates/macros.tpl
Normal file
5
sandbox/templates/macros.tpl
Normal file
@ -0,0 +1,5 @@
|
||||
{macro factorial(num)}
|
||||
{if $num}
|
||||
{$num} {macro.factorial num=$num-1} {$num}
|
||||
{/if}
|
||||
{/macro}
|
Reference in New Issue
Block a user