create instance each render method.

This commit is contained in:
Hiroaki Matsuura
2016-03-11 11:32:00 +09:00
parent ef02715fca
commit 9cdea69285

View File

@ -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();
}
}