summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Helper/Hook.php20
-rw-r--r--app/Template/layout.php3
2 files changed, 23 insertions, 0 deletions
diff --git a/app/Helper/Hook.php b/app/Helper/Hook.php
index d7fe3d34..bf879878 100644
--- a/app/Helper/Hook.php
+++ b/app/Helper/Hook.php
@@ -11,6 +11,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
*
* @access public
diff --git a/app/Template/layout.php b/app/Template/layout.php
index 49ac2a08..cba8d2a3 100644
--- a/app/Template/layout.php
+++ b/app/Template/layout.php
@@ -21,6 +21,9 @@
<?= $this->asset->css('assets/css/print.css', true, 'print') ?>
<?= $this->asset->customCss() ?>
+ <?= $this->hook->asset('css', 'template:layout:css') ?>
+ <?= $this->hook->asset('js', 'template:layout:js') ?>
+
<link rel="icon" type="image/png" href="<?= $this->url->dir() ?>assets/img/favicon.png">
<link rel="apple-touch-icon" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad.png">