From 709790a05d7cd122b9f8fcabbf70e17e0d597375 Mon Sep 17 00:00:00 2001 From: Alexander Shapoval Date: Mon, 10 Sep 2018 03:55:10 +0300 Subject: [PATCH] Added method getLayout() to Controller (#3765) Credit to @ebashu-on-holidays --- modules/cms/classes/Controller.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 291da0eb8..4da911b56 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -1134,6 +1134,17 @@ class Controller return $this->layoutObj; } + /** + * Returns the CMS layout object being processed by the controller. + * The object is not available on the early stages of the controller + * initialization. + * @return \Cms\Classes\Layout Returns the Layout object or null. + */ + public function getLayout() + { + return $this->layout; + } + // // Page helpers //