Fixing fatal error with $this->controller->layout in Application class.
Closes #736
This commit is contained in:
parent
8d2c7045a4
commit
5dced5f990
|
@ -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();
|
||||
|
|
|
@ -30,6 +30,11 @@ class Controller extends \b8\Controller
|
|||
*/
|
||||
protected $view;
|
||||
|
||||
/**
|
||||
* @var \b8\View
|
||||
*/
|
||||
public $layout;
|
||||
|
||||
/**
|
||||
* Initialise the controller.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue