Add predefined accessors Fenom::ACCESSOR_PROPERY and Fenom::ACCESSOR_METHOD

This commit is contained in:
bzick
2015-08-13 00:07:01 +03:00
parent bf44511a53
commit 4fe339ba21
4 changed files with 80 additions and 9 deletions

View File

@@ -7,8 +7,8 @@ require_once __DIR__.'/../tests/tools.php';
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled');
$fenom->setOptions(Fenom::AUTO_RELOAD | Fenom::FORCE_COMPILE);
$fenom->addAccessorSmart('g', 'App::$q->get', Fenom::ACCESSOR_CALL);
var_dump($fenom->compileCode('{$.g("env")}')->getBody());
$fenom->addAccessorSmart('fetch', 'fetch', Fenom::ACCESSOR_METHOD);
var_dump($fenom->compileCode('{$.fetch("template.tpl")}')->getBody());
//var_dump($fenom->compile("bug158/main.tpl", [])->getTemplateCode());
//var_dump($fenom->display("bug158/main.tpl", []));
// $fenom->getTemplate("problem.tpl");