mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add array of variable to tag-function's arguments
This commit is contained in:
parent
4beacd57b9
commit
76b5d3e6fa
@ -648,10 +648,10 @@ class Compiler
|
||||
public static function stdFuncParser(Tokenizer $tokens, Tag $tag)
|
||||
{
|
||||
if(is_string($tag->callback)) {
|
||||
return $tag->out($tag->callback . "(" . self::toArray($tag->tpl->parseParams($tokens)) . ', $tpl)');
|
||||
return $tag->out($tag->callback . "(" . self::toArray($tag->tpl->parseParams($tokens)) . ', $tpl, $var)');
|
||||
} else {
|
||||
return '$info = $tpl->getStorage()->getTag('.var_export($tag->name, true).');'.PHP_EOL.
|
||||
$tag->out('call_user_func($info["function"], '.self::toArray($tag->tpl->parseParams($tokens)).', $tpl)');
|
||||
$tag->out('call_user_func_array($info["function"], array('.self::toArray($tag->tpl->parseParams($tokens)).', $tpl, &$var))');
|
||||
}
|
||||
}
|
||||
|
||||
@ -709,10 +709,10 @@ class Compiler
|
||||
{
|
||||
$tag->restore(\Fenom::AUTO_ESCAPE);
|
||||
if(is_string($tag->callback)) {
|
||||
return $tag->out($tag->callback . "(" . $tag["params"] . ', ob_get_clean(), $tpl)');
|
||||
return $tag->out($tag->callback . "(" . $tag["params"] . ', ob_get_clean(), $tpl, $var)');
|
||||
} else {
|
||||
return '$info = $tpl->getStorage()->getTag('.var_export($tag->name, true).');'.PHP_EOL.
|
||||
$tag->out('call_user_func($info["function"], ' . $tag["params"] . ', ob_get_clean(), $tpl)');
|
||||
$tag->out('call_user_func_array($info["function"], array(' . $tag["params"] . ', ob_get_clean(), $tpl, &$var))');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user