Tpl: add register_modifier() method

This commit is contained in:
Benjamin Renard 2024-11-14 15:23:14 +01:00
parent 4d8c08fabd
commit 44fc339057
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -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