summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/Hook.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/Helper/Hook.php b/app/Helper/Hook.php
index 77756757..d7fe3d34 100644
--- a/app/Helper/Hook.php
+++ b/app/Helper/Hook.php
@@ -10,8 +10,6 @@ namespace Helper;
*/
class Hook extends \Core\Base
{
- private $hooks = array();
-
/**
* Render all attached hooks
*
@@ -24,10 +22,8 @@ class Hook extends \Core\Base
{
$buffer = '';
- foreach ($this->hooks as $name => $template) {
- if ($hook === $name) {
- $buffer .= $this->template->render($template, $variables);
- }
+ foreach ($this->hook->getListeners($hook) as $template) {
+ $buffer .= $this->template->render($template, $variables);
}
return $buffer;
@@ -43,7 +39,7 @@ class Hook extends \Core\Base
*/
public function attach($hook, $template)
{
- $this->hooks[$hook] = $template;
+ $this->hook->on($hook, $template);
return $this;
}
}