Fixing fatal error with $this->controller->layout in Application class.

Closes #736
This commit is contained in:
corpsee 2015-01-11 16:44:34 +06:00 committed by Dan Cryer
parent 8d2c7045a4
commit 5dced5f990
2 changed files with 11 additions and 1 deletions

View file

@ -22,6 +22,11 @@ use PHPCI\Model\Build;
*/
class Application extends b8\Application
{
/**
* @var \PHPCI\Controller
*/
protected $controller;
/**
* Initialise PHPCI - Handles session verification, routing, etc.
*/
@ -100,7 +105,7 @@ class Application extends b8\Application
$this->response->setContent($view->render());
}
if ($this->response->hasLayout()) {
if ($this->response->hasLayout() && $this->controller->layout) {
$this->setLayoutVariables($this->controller->layout);
$this->controller->layout->content = $this->response->getContent();

View file

@ -30,6 +30,11 @@ class Controller extends \b8\Controller
*/
protected $view;
/**
* @var \b8\View
*/
public $layout;
/**
* Initialise the controller.
*/