mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
Fix function call compilation using {functionname} syntax for in-template defined functions.
This commit is contained in:
@@ -1112,10 +1112,10 @@ class Template extends BaseCompiler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// template defined by {template} tag
|
// call to function previousely defined by {function} tag
|
||||||
if ($this->canCompileTemplateCall($tag)) {
|
if ($this->canCompileTemplateFunctionCall($tag)) {
|
||||||
$args['_attr']['name'] = "'{$tag}'";
|
$args['_attr']['name'] = "'{$tag}'";
|
||||||
$tagCompiler = $this->getTagCompiler($tag);
|
$tagCompiler = $this->getTagCompiler('call');
|
||||||
// compile this tag
|
// compile this tag
|
||||||
$_output = $tagCompiler === null ? false : $tagCompiler->compile($args, $this, $parameter);
|
$_output = $tagCompiler === null ? false : $tagCompiler->compile($args, $this, $parameter);
|
||||||
return $this->has_code ? $_output : null;
|
return $this->has_code ? $_output : null;
|
||||||
@@ -1324,7 +1324,7 @@ class Template extends BaseCompiler {
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function canCompileTemplateCall(string $tag): bool {
|
private function canCompileTemplateFunctionCall(string $tag): bool {
|
||||||
return
|
return
|
||||||
isset($this->parent_compiler->tpl_function[$tag])
|
isset($this->parent_compiler->tpl_function[$tag])
|
||||||
|| (
|
|| (
|
||||||
|
Reference in New Issue
Block a user