mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add Fenom::ACCESSOR_CALL parser
This commit is contained in:
parent
c6dbdfff95
commit
48e4931506
@ -7,7 +7,8 @@ require_once __DIR__.'/../tests/tools.php';
|
||||
|
||||
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled');
|
||||
$fenom->setOptions(Fenom::AUTO_RELOAD | Fenom::FORCE_COMPILE);
|
||||
//var_dump($fenom->compileCode('{set $z = "A"~~"B"}')->getBody());
|
||||
$fenom->addAccessorSmart('g', 'App::$q->get', Fenom::ACCESSOR_CALL);
|
||||
var_dump($fenom->compileCode('{$.g("env")}')->getBody());
|
||||
//var_dump($fenom->compile("bug158/main.tpl", [])->getTemplateCode());
|
||||
var_dump($fenom->display("bug158/main.tpl", []));
|
||||
//var_dump($fenom->display("bug158/main.tpl", []));
|
||||
// $fenom->getTemplate("problem.tpl");
|
@ -33,8 +33,9 @@ class Accessor {
|
||||
return $tpl->parseVariable($tokens, $var);
|
||||
}
|
||||
|
||||
public static function parserCall($accessor, Tokenizer $tokens, Template $tpl) {
|
||||
// return $tpl->parseVariable($tokens, $var);
|
||||
|
||||
public static function parserCall($call, Tokenizer $tokens, Template $tpl) {
|
||||
return $call.$tpl->parseArgs($tokens);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1442,7 +1442,6 @@ class Template extends Render
|
||||
* (1 + 2.3, 'string', $var, [2,4])
|
||||
*
|
||||
* @param Tokenizer $tokens
|
||||
* @param bool $as_string
|
||||
* @return string
|
||||
*/
|
||||
public function parseArgs(Tokenizer $tokens)
|
||||
|
Loading…
Reference in New Issue
Block a user