From 9cdea69285acbf712463b38a9bb0b5ce23c4c98c Mon Sep 17 00:00:00 2001 From: Hiroaki Matsuura Date: Fri, 11 Mar 2016 11:32:00 +0900 Subject: [PATCH] create instance each render method. --- src/Blade.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Blade.php b/src/Blade.php index 3fe28d0..ee5efc9 100644 --- a/src/Blade.php +++ b/src/Blade.php @@ -17,6 +17,11 @@ class Blade */ protected $cachePath; + /** + * @var Dispatcher|null + */ + protected $events; + /** * @var array */ @@ -35,8 +40,8 @@ class Blade } $this->viewPaths = $viewPaths; $this->cachePath = $cachePath; + $this->events = $events; $this->attributes = $attributes; - $this->renderer = new \Philo\Blade\Blade($viewPaths, $cachePath, $events); } /** @@ -164,6 +169,7 @@ class Blade $data = array_merge($this->attributes, $data); - return $this->renderer->view()->make($template, $data)->render(); + $renderer = new \Philo\Blade\Blade($this->viewPaths, $this->cachePath, $this->events); + return $renderer->view()->make($template, $data)->render(); } } \ No newline at end of file