From d642f3c9ddc56aae1a3ca2dd8638d32728da4c72 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 16 Dec 2024 17:52:13 +0100 Subject: [PATCH] Tpl::register_callable(): fix registering function --- src/Tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tpl.php b/src/Tpl.php index 6b49137..76a57e4 100644 --- a/src/Tpl.php +++ b/src/Tpl.php @@ -272,8 +272,8 @@ class Tpl { } else { $function = new \ReflectionFunction($callable); - $default_smarty_function_name = "smarty_$function"; - $default_smarty_name = $callable; + $default_smarty_function_name = sprintf("smarty_%s", $function->getName()); + $default_smarty_name = $function->getName(); $callable_txt = $callable; $params = $function->getParameters(); }