From 0e3d909bd05c295218c96bf02f28bf09cadd1e3b Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Wed, 3 Sep 2014 08:48:15 +1000 Subject: [PATCH] Add missing refs and accessors for pageObj and layoutObj --- modules/cms/classes/Controller.php | 50 +++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 6edf16b05..67a974799 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -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. *