-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBootstrap.php
36 lines (32 loc) · 997 Bytes
/
Bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace liuxy\admin;
use yii\base\BootstrapInterface;
/**
* liuxy module bootstrap class.
*/
class Bootstrap implements BootstrapInterface {
/**
* @inheritdoc
*/
public function bootstrap($app) {
// Add module URL rules.
$app->getUrlManager()->addRules(
[
'' => \Yii::$app->defaultRoute,
'<_m>/<_c>/<_a>' => '<_m>/<_c>/<_a>',
'<_m>/<_c>/<_a>.json' => '<_m>/<_c>/<_a>'
]
);
// Add module I18N category.
if (!isset($app->i18n->translations['liuxy/admin']) && !isset($app->i18n->translations['liuxy/*'])) {
$app->i18n->translations['liuxy/admin'] = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@liuxy/admin/views/messages',
'forceTranslation' => true,
'fileMap' => [
'liuxy/admin' => 'admin.php',
]
];
}
}
}