fenom/sandbox/fenom.php

16 lines
654 B
PHP
Raw Normal View History

2013-07-22 18:03:43 +04:00
<?php
2014-11-05 16:07:50 +03:00
require_once __DIR__.'/../src/Fenom.php';
require_once __DIR__.'/../tests/tools.php';
2013-08-11 19:55:30 +04:00
2014-11-05 16:07:50 +03:00
\Fenom::registerAutoload();
2014-04-17 23:50:18 +04:00
2016-04-11 20:19:31 +03:00
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/../tests/resources/compile');
2015-08-13 14:55:00 +03:00
$fenom->setOptions(Fenom::AUTO_RELOAD);
2016-04-11 20:19:31 +03:00
$fenom->addModifier('firstimg', function ($img) {
return $img;
});
2016-05-06 23:04:08 +03:00
var_dump($fenom->compileCode('{foreach $list as $k => $e last=$l first=$f index=$i} {if $f}first{/if} {$i}: {$k} => {$e}, {if $l}last{/if} {/foreach}')->getTemplateCode());
2015-06-03 00:13:09 +03:00
//var_dump($fenom->compile("bug158/main.tpl", [])->getTemplateCode());
2015-06-03 11:31:53 +03:00
//var_dump($fenom->display("bug158/main.tpl", []));
2014-11-05 16:07:50 +03:00
// $fenom->getTemplate("problem.tpl");