controllerMap['migrate']['migrationPath'][] = '@common/modules/banners/migrations'; // add search rules $app->params['search_rules'][] = "SELECT title, title as content, CONCAT('/banners/manage/banner/view/', id) AS url FROM {{banners}}"; $app->getUrlManager()->addRules([ 'banners/manage/banner/view/' => 'banners/manage/banner/view', ]); // add languages $app->getI18n()->translations = ArrayHelper::merge($app->getI18n()->translations, [ 'banners' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@common/modules/banners/messages', ], ]); // add menu items if (basename(\Yii::$app->getBasePath()) === 'backend') { $app->params['adminMenu'][] = [ 'label' => \Yii::t( 'banners', 'Banners' ), 'icon' => 'flag', 'items' => [ [ 'label' => \Yii::t( 'banners', 'Banners' ), 'icon' => 'caret-right', 'url' => [ '/banners/manage/banner/index' ], //'active' => \Yii::$app->controller->getUniqueId() == 'banners/manage/banner' ], [ 'label' => \Yii::t( 'banners', 'Places' ), 'icon' => 'caret-right', 'url' => [ '/banners/manage/place/index' ], //'active' => \Yii::$app->controller->getUniqueId() == 'banners/manage/place' ], ], 'visible' => $app->user->can( 'admin' ) || \Yii::$app->user->can( 'BannersManagement' ), ]; } } }