Add missing refs and accessors for pageObj and layoutObj

This commit is contained in:
Sam Georges 2014-09-03 08:48:15 +10:00
parent 8c07bfea15
commit 0e3d909bd0
1 changed files with 39 additions and 11 deletions

View File

@ -54,15 +54,25 @@ class Controller extends BaseController
protected $loader;
/**
* @var \Cms\Classes\Page A reference to the CMS page being processed.
* @var \Cms\Classes\Page A reference to the CMS page template being processed.
*/
protected $page;
/**
* @var \Cms\Classes\Layout A reference to the CMS layout used by the page.
* @var \Cms\Classes\CodeBase A reference to the CMS page code section object.
*/
protected $pageObj;
/**
* @var \Cms\Classes\Layout A reference to the CMS layout template used by the page.
*/
protected $layout;
/**
* @var \Cms\Classes\CodeBase A reference to the CMS layout code section object.
*/
protected $layoutObj;
/**
* @var \Twig_Environment Keeps the Twig environment object.
*/
@ -282,15 +292,6 @@ class Controller extends BaseController
$this->twig->addExtension(new DebugExtension($this));
}
/**
* Returns the Twig environment.
* @return Twig_Environment
*/
public function getTwig()
{
return $this->twig;
}
/**
* Initializes the custom layout and page objects.
* @return void
@ -764,6 +765,15 @@ class Controller extends BaseController
return $this->theme;
}
/**
* Returns the Twig environment.
* @return Twig_Environment
*/
public function getTwig()
{
return $this->twig;
}
/**
* Returns the routing object.
* @return \Cms\Classes\Router
@ -773,6 +783,24 @@ class Controller extends BaseController
return $this->router;
}
/**
* Intended to be called from the layout, returns the page code base object.
* @return \Cms\Classes\CodeBase
*/
public function getPageObject()
{
return $this->pageObj;
}
/**
* Intended to be called from the page, returns the layout code base object.
* @return \Cms\Classes\CodeBase
*/
public function getLayoutObject()
{
return $this->layoutObj;
}
/**
* Looks up the URL for a supplied page and returns it relative to the website root.
*