From d17c547bcaf32c85308d162828c4f45d0bc13775 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 15 Feb 2023 17:12:56 +0100 Subject: [PATCH] add $params as optional parameter to hook twig function --- system/twig.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/twig.php b/system/twig.php index 87d2ad6f..4f3639d8 100644 --- a/system/twig.php +++ b/system/twig.php @@ -90,14 +90,14 @@ $function = new TwigFunction('truncate', function ($s, $n) { }); $twig->addFunction($function); -$function = new TwigFunction('hook', function ($hook) { +$function = new TwigFunction('hook', function ($hook, array $params = []) { global $hooks; if(is_string($hook)) { $hook = constant($hook); } - $hooks->trigger($hook); + $hooks->trigger($hook, $params); }); $twig->addFunction($function);