From 44fc339057406a310905b1234269e94802ad6320 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 14 Nov 2024 15:23:14 +0100 Subject: [PATCH] Tpl: add register_modifier() method --- src/Tpl.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Tpl.php b/src/Tpl.php index 009c083..9a90fba 100644 --- a/src/Tpl.php +++ b/src/Tpl.php @@ -233,6 +233,16 @@ class Tpl { self :: $smarty -> registerPlugin("function", $name, $callable); } + /** + * Register a modifier usable from template files + * @param string $name The modifier name + * @param callable $callable The modifier function + * @return void + */ + public static function register_modifier($name, $callable) { + self :: $smarty -> registerPlugin("modifier", $name, $callable); + } + /** * Register a class usable from template files * @param string $class_name The class name