|
|
@ -167,23 +167,19 @@ abstract class Module extends Component |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Initializes the module. |
|
|
|
* Initializes the module. |
|
|
|
* This method is called after the module is created and initialized with property values |
|
|
|
* This method is called after the module is created and initialized with property values |
|
|
|
* given in configuration. The default implement will create a path alias using the module [[id]] |
|
|
|
* 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]]. |
|
|
|
* and then call [[preloadComponents()]] to load components that are declared in [[preload]]. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function init() |
|
|
|
public function init() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->preloadComponents(); |
|
|
|
$this->preloadComponents(); |
|
|
|
if ($this->controllerNamespace === null) { |
|
|
|
if ($this->controllerNamespace === null) { |
|
|
|
if ($this instanceof Application) { |
|
|
|
|
|
|
|
$this->controllerNamespace = 'app\\controllers'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$class = get_class($this); |
|
|
|
$class = get_class($this); |
|
|
|
if (($pos = strrpos($class, '\\')) !== false) { |
|
|
|
if (($pos = strrpos($class, '\\')) !== false) { |
|
|
|
$this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; |
|
|
|
$this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns an ID that uniquely identifies this module among all modules within the current application. |
|
|
|
* Returns an ID that uniquely identifies this module among all modules within the current application. |
|
|
|