| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Bootstrap |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Bootstrap constructor. |
||
| 15 | */ |
||
| 16 | public function __construct() |
||
| 17 | { |
||
| 18 | $this->registerTranslate(); |
||
| 19 | $this->registerRules(); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Translate |
||
| 24 | */ |
||
| 25 | protected function registerTranslate() |
||
| 26 | { |
||
| 27 | $i18n = Yii::$app->i18n; |
||
| 28 | $i18n->translations['modules/admin/*'] = [ |
||
| 29 | 'class' => 'yii\i18n\PhpMessageSource', |
||
| 30 | 'basePath' => '@modules/admin/messages', |
||
| 31 | 'fileMap' => [ |
||
| 32 | 'modules/admin/module' => 'module.php', |
||
| 33 | 'modules/admin/users' => 'users.php', |
||
| 34 | 'modules/admin/rbac' => 'rbac.php', |
||
| 35 | ], |
||
| 36 | ]; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Rules |
||
| 41 | */ |
||
| 42 | protected function registerRules() |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return array |
||
| 50 | */ |
||
| 51 | protected function rules() |
||
| 62 | } |
||
| 63 | } |
||
| 64 |