Fixes #328 - Move Twig init to Controller constructor

This commit is contained in:
Sam Georges 2014-06-20 17:37:01 +10:00
parent b3bbfb154b
commit dc9acd472a

View File

@ -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()
{