diff --git a/system/twig.php b/system/twig.php index 34e65a2d..8d8790d3 100644 --- a/system/twig.php +++ b/system/twig.php @@ -38,6 +38,11 @@ $twig->addFunction($function); $function = new Twig_SimpleFunction('hook', function ($hook) { global $hooks; + + if(is_string($hook)) { + $hook = constant($hook); + } + $hooks->trigger($hook); }); $twig->addFunction($function); @@ -51,4 +56,4 @@ $filter = new Twig_SimpleFilter('urlencode', function ($s) { return urlencode($s); }); $twig->addFilter($filter); -unset($function, $filter); \ No newline at end of file +unset($function, $filter);