Add reference hooks

This commit is contained in:
Frederic Guillot
2016-08-13 14:23:53 -04:00
parent 29820bf83b
commit 4ffaba2ba0
8 changed files with 97 additions and 31 deletions

View File

@@ -96,4 +96,21 @@ class Hook
return null;
}
/**
* Hook with reference
*
* @access public
* @param string $hook
* @param mixed $param
* @return mixed
*/
public function reference($hook, &$param)
{
foreach ($this->getListeners($hook) as $listener) {
$listener($param);
}
return $param;
}
}