From 98bd4041dc42675e2536dd9291a6acb2151d8975 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 21 Oct 2013 20:58:21 -0400 Subject: [PATCH] adjusted calling sequence within init(). --- framework/yii/base/Module.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index 1fdf5ee..fefdf1d 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -168,16 +168,18 @@ abstract class Module extends Component * This method is called after the module is created and initialized with property values * given in configuration. The default implementation will create a path alias using the module [[id]] * and then call [[preloadComponents()]] to load components that are declared in [[preload]]. + * + * If you override this method, please make sure you call the parent implementation. */ 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'; } } + $this->preloadComponents(); } /**