Add plugin hooks for assets

This commit is contained in:
Frederic Guillot
2015-09-21 21:07:15 -04:00
parent 2cff1d6a37
commit 78ecdc05c3
4 changed files with 87 additions and 1 deletions

View File

@@ -10,6 +10,26 @@ namespace Helper;
*/
class Hook extends \Core\Base
{
/**
* Add assets JS or CSS
*
* @access public
* @param string $type
* @param string $hook
* @param array $variables
* @return string
*/
public function asset($type, $hook)
{
$buffer = '';
foreach ($this->hook->getListeners($hook) as $file) {
$buffer .= $this->helper->asset->$type($file);
}
return $buffer;
}
/**
* Render all attached hooks
*