From 2cf658c9c3a9579cb8def18c3e95f3fc4d87d6be Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 23 Jan 2023 16:56:42 +0100 Subject: [PATCH] Fix function call compilation using {functionname} syntax for in-template defined functions. --- src/Compiler/Template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Template.php b/src/Compiler/Template.php index 3a5db510..c69f8185 100644 --- a/src/Compiler/Template.php +++ b/src/Compiler/Template.php @@ -1112,10 +1112,10 @@ class Template extends BaseCompiler { } } - // template defined by {template} tag - if ($this->canCompileTemplateCall($tag)) { + // call to function previousely defined by {function} tag + if ($this->canCompileTemplateFunctionCall($tag)) { $args['_attr']['name'] = "'{$tag}'"; - $tagCompiler = $this->getTagCompiler($tag); + $tagCompiler = $this->getTagCompiler('call'); // compile this tag $_output = $tagCompiler === null ? false : $tagCompiler->compile($args, $this, $parameter); return $this->has_code ? $_output : null; @@ -1324,7 +1324,7 @@ class Template extends BaseCompiler { * @return bool * @throws Exception */ - private function canCompileTemplateCall(string $tag): bool { + private function canCompileTemplateFunctionCall(string $tag): bool { return isset($this->parent_compiler->tpl_function[$tag]) || (