getSmarty()->getFunctionHandler($function)) { $attribute_overrides = []; if ($functionHandler instanceof AttributeFunctionHandlerInterface) { $attribute_overrides = $functionHandler->getSupportedAttributes(); } // check and get attributes $_attr = (new AttributeCompiler( $attribute_overrides['required_attributes'] ?? $this->required_attributes, $attribute_overrides['optional_attributes'] ?? $this->optional_attributes, $attribute_overrides['shorttag_order'] ?? $this->shorttag_order, $attribute_overrides['option_flags'] ?? $this->option_flags ))->getAttributes($compiler, $args); unset($_attr['nocache']); $_paramsArray = $this->formatParamsArray($_attr); $_params = 'array(' . implode(',', $_paramsArray) . ')'; // not cacheable? $compiler->tag_nocache = $compiler->tag_nocache || !$functionHandler->isCacheable(); $output = "\$_smarty_tpl->getSmarty()->getFunctionHandler(" . var_export($function, true) . ")"; $output .= "->handle($_params, \$_smarty_tpl)"; } else { $compiler->trigger_template_error("unknown function '{$function}'", null, true); } if (!empty($parameter['modifierlist'])) { $output = $compiler->compileModifier($parameter['modifierlist'], $output); } return $output; } }