diff --git a/PHPCI/Application.php b/PHPCI/Application.php index 88380c87..a8790804 100644 --- a/PHPCI/Application.php +++ b/PHPCI/Application.php @@ -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(); diff --git a/PHPCI/Controller.php b/PHPCI/Controller.php index b065e857..5fd22594 100644 --- a/PHPCI/Controller.php +++ b/PHPCI/Controller.php @@ -30,6 +30,11 @@ class Controller extends \b8\Controller */ protected $view; + /** + * @var \b8\View + */ + public $layout; + /** * Initialise the controller. */