From a6a00a00400f164c4b18094999a5ed72366dd519 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 13 Sep 2015 14:07:56 -0400 Subject: First draft for plugins system --- app/Helper/Hook.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/Helper/Hook.php (limited to 'app/Helper') diff --git a/app/Helper/Hook.php b/app/Helper/Hook.php new file mode 100644 index 00000000..77756757 --- /dev/null +++ b/app/Helper/Hook.php @@ -0,0 +1,49 @@ +hooks as $name => $template) { + if ($hook === $name) { + $buffer .= $this->template->render($template, $variables); + } + } + + return $buffer; + } + + /** + * Attach a template to a hook + * + * @access public + * @param string $hook + * @param string $template + * @return \Helper\Hook + */ + public function attach($hook, $template) + { + $this->hooks[$hook] = $template; + return $this; + } +} -- cgit v1.2.3