From 8e1199b0f6ee5371c1dbc39037b088890731ca8b Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sat, 19 Oct 2013 23:24:51 +0400 Subject: [PATCH] Moved setting controllerNamespace back to init --- framework/yii/base/Module.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index 996d0f2..1fdf5ee 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -126,15 +126,9 @@ abstract class Module extends Component */ public function __construct($id, $parent = null, $config = []) { - parent::__construct($config); $this->id = $id; $this->module = $parent; - if ($this->controllerNamespace === null) { - $class = get_class($this); - if (($pos = strrpos($class, '\\')) !== false) { - $this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; - } - } + parent::__construct($config); } /** @@ -178,6 +172,12 @@ abstract class Module extends Component public function init() { $this->preloadComponents(); + if ($this->controllerNamespace === null) { + $class = get_class($this); + if (($pos = strrpos($class, '\\')) !== false) { + $this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; + } + } } /**