luya\base\Module::init PHP Method

init() public method

public init ( )
    public function init()
    {
        parent::init();
        // verify all the components
        foreach ($this->requiredComponents as $component) {
            if (!Yii::$app->has($component)) {
                throw new Exception(sprintf('The required component "%s" is not registered in the configuration file', $component));
            }
        }
        $this->registerTranslations();
    }

Usage Example

Example #1
0
 public function init()
 {
     parent::init();
     if (empty($this->password)) {
         throw new Exception("The basicauth module password can not be empty, please add a password to the module config for basicauth.");
     }
 }
All Usage Examples Of luya\base\Module::init