From dc9acd472a2fc8d81eff3424976666a312adfd00 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Fri, 20 Jun 2014 17:37:01 +1000 Subject: [PATCH] Fixes #328 - Move Twig init to Controller constructor --- modules/cms/classes/Controller.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 188900578..e8854caad 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -93,6 +93,7 @@ class Controller extends BaseController $this->theme = $theme ? $theme : Theme::getActiveTheme(); $this->assetPath = Config::get('cms.themesDir').'/'.$this->theme->getDirName(); $this->router = new Router($this->theme); + $this->initTwigEnvironment(); } /** @@ -145,8 +146,6 @@ class Controller extends BaseController $this->layout = $layout; - $this->initTwigEnvironment(); - /* * The 'this' variable is reserved for default variables. */ @@ -218,7 +217,7 @@ class Controller extends BaseController /** * Initializes the Twig environment and loader. * Registers the \Cms\Twig\Extension object with Twig. - * @return \Twig_Environment Returns the Twig environment object. + * @return void */ protected function initTwigEnvironment() {