Bootstrap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 17
rs 9.9332
cc 1
nc 1
nop 0
1
<?php
2
3
namespace modules\main;
4
5
use Yii;
6
7
/**
8
 * Class Bootstrap
9
 * @package modules\main
10
 */
11
class Bootstrap
12
{
13
    public function __construct()
14
    {
15
        $i18n = Yii::$app->i18n;
16
        $i18n->translations['modules/main/*'] = [
17
            'class' => 'yii\i18n\PhpMessageSource',
18
            'basePath' => '@modules/main/messages',
19
            'fileMap' => [
20
                'modules/main/module' => 'module.php',
21
            ],
22
        ];
23
24
        $urlManager = Yii::$app->urlManager;
25
        $urlManager->addRules(
26
            [
27
                // Declaration of rules here
28
                '' => 'main/default/index',
29
                '<_a:(about|contact|captcha)>' => 'main/default/<_a>',
30
            ]
31
        );
32
    }
33
}
34