From f0433fb79aa450c69e98c96cbc1def70b4a76568 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Sun, 12 Apr 2015 17:55:27 +0100 Subject: [PATCH] Added the basic php renderer --- config/notifier.php | 2 +- src/Notifier/Renderers/Basic.php | 59 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/Notifier/Renderers/Basic.php diff --git a/config/notifier.php b/config/notifier.php index 31311b7..55ad064 100644 --- a/config/notifier.php +++ b/config/notifier.php @@ -122,6 +122,6 @@ * Coreplex\Notifier\Session\Native * Coreplex\Notifier\Session\IlluminateSession */ - 'session' => 'Coreplex\\Notifier\\Session\\Native', + 'session' => 'Coreplex\\Notifier\\Session\\IlluminateSession', ]; \ No newline at end of file diff --git a/src/Notifier/Renderers/Basic.php b/src/Notifier/Renderers/Basic.php new file mode 100644 index 0000000..e46ade7 --- /dev/null +++ b/src/Notifier/Renderers/Basic.php @@ -0,0 +1,59 @@ +template; + + if ( ! file_exists($template)) { + dd('template does not exist'); + } + + // Extract the passed variables + extract($data); + + // include the template + include ($template); + + // Get the content + $content = ob_get_contents(); + // Clear the output buffer + ob_end_clean(); + + // Return the content + return $content; + } + + /** + * Set the template to be used by the renderer. + * + * @param $template + * @return $this + */ + public function setTemplate($template) + { + $this->template = $template; + + return $this; + } + +} \ No newline at end of file