Merge branch 'develop' into feature/settings

This commit is contained in:
slawkens
2023-07-20 14:24:46 +02:00
5 changed files with 20 additions and 9 deletions

View File

@@ -90,15 +90,16 @@ $function = new TwigFunction('truncate', function ($s, $n) {
});
$twig->addFunction($function);
$function = new TwigFunction('hook', function ($hook, array $params = []) {
$function = new TwigFunction('hook', function ($context, $hook, array $params = []) {
global $hooks;
if(is_string($hook)) {
$hook = constant($hook);
}
$params['context'] = $context;
$hooks->trigger($hook, $params);
});
}, ['needs_context' => true]);
$twig->addFunction($function);
$function = new TwigFunction('config', function ($key) {