-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
executable file
·94 lines (92 loc) · 2.82 KB
/
main.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
$params = array_merge(
require(__DIR__.'/../../common/config/params.php'),
require(__DIR__.'/params.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'components' => [
'request' => [
'csrfParam' => '_csrfBackend'
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'authManager' => [
'class' => 'rbac\components\DbManager',
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'formatter' => [
'class' => 'backend\components\Formatter',
'booleanFormat' => ['<i class="fa fa-times text-danger"></i>', '<i class="fa fa-check text-success"></i>']
],
'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath'=>'@common/messages',
'fileMap' => ['app' => 'backend.php'],
'on missingTranslation' => ['\backend\modules\i18n\Module', 'missingTranslation']
],
],
],
'themeManager' => [
'class' => 'common\components\ThemeManager',
],
],
'modules' => [
'rbac' => [
'class' => 'rbac\Module',
],
'backup' => [
'class' => 'backup\Module',
],
'i18n' => [
'class' => 'backend\modules\i18n\Module',
'defaultRoute'=>'i18n-message/index'
],
'gii' => [
'class' => 'gii\Module',
'generators' => [
'crud' => [
'class' => 'yii\gii\generators\crud\Generator',
'templates' => [
'default' => '@gii/generators/crud/default'
]
],
'model' => [
'class' => 'gii\\generators\model\\Generator',
'useTablePrefix' => true,
'ns' => 'common\\models'
]
]
],
'migration' => [
'class' => 'migration\Module',
],
],
'aliases' => [
'@rbac' => '@backend/modules/rbac',
'@backup' => '@backend/modules/backup',
'@gii' => '@backend/modules/gii',
'@migration' => '@backend/modules/migration',
],
'as access' => [
'class' => 'rbac\components\AccessControl',
'allowActions' => [
'user/admin/logout'
],
],
'as adminLog' => 'backend\\behaviors\\AdminLogBehavior',
'params' => $params,
];