yii\base\Module::init PHP Method

init() public method

This method is called after the module is created and initialized with property values given in configuration. The default implementation will initialize [[controllerNamespace]] if it is not set. If you override this method, please make sure you call the parent implementation.
public init ( )
    public function init()
    {
        if ($this->controllerNamespace === null) {
            $class = get_class($this);
            if (($pos = strrpos($class, '\\')) !== false) {
                $this->controllerNamespace = substr($class, 0, $pos) . '\\controllers';
            }
        }
    }

Usage Example

Example #1
3
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     if (\Yii::$app->authManager === null) {
         throw new InvalidConfigException('You forgot configure the "authManager" component.');
     }
     parent::init();
 }
All Usage Examples Of yii\base\Module::init