_service = $service; } /** * First modules initialization */ public function actionInit() : void { \Yii::$app->moduleManager->getModules(); } /** * Activate module and apply it migration if needed * @param $name */ public function actionActivate($name) { $module = ModuleRecord::find()->andWhere(['name' => $name])->one(); if ($module || $module->isDisabled()) { $this->_service->enable($module); } } }