Completed
Push — master ( ae08e3...aed614 )
by Alexey
03:06
created

Bootstrap   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 22 1
1
<?php
2
3
namespace modules\admin;
4
5
use Yii;
6
7
/**
8
 * Class Bootstrap
9
 * @package modules\admin
10
 */
11
class Bootstrap
12
{
13
    public function __construct()
14
    {
15
        $i18n = Yii::$app->i18n;
16
        $i18n->translations['modules/admin/*'] = [
17
            'class' => 'yii\i18n\PhpMessageSource',
18
            'basePath' => '@modules/admin/messages',
19
            'fileMap' => [
20
                'modules/admin/module' => 'module.php',
21
                'modules/admin/users' => 'users.php',
22
            ],
23
        ];
24
25
        $urlManager = Yii::$app->urlManager;
26
        $urlManager->addRules(
27
            [
28
                // Declaration of rules here
29
                'admin/users' => 'admin/user/index',
30
                'admin/user/<id:\d+>/<_a:[\w\-]+>' => 'admin/user/<_a>',
31
                'admin/users/<_a:[\w\-]+>' => 'admin/user/<_a>',
32
33
                'admin' => 'admin/default/index',
34
                'admin/<_a:[\w\-]+>' => 'admin/default/<_a>',
35
            ]
36
        );
37
    }
38
}
39