Passed
Push — master ( 52e635...9c309d )
by Alexey
02:46
created

Bootstrap::bootstrap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 19
rs 9.4285
cc 1
eloc 10
nc 1
nop 1
1
<?php
2
namespace modules\main;
3
4
use yii\base\BootstrapInterface;
5
6
/**
7
 * Class Bootstrap
8
 * @package modules\main
9
 */
10
class Bootstrap implements BootstrapInterface
11
{
12
    /**
13
     * @inheritdoc
14
     * @param \yii\base\Application $app
15
     */
16
    public function bootstrap($app)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
17
    {
18
        // i18n
19
        $app->i18n->translations['modules/main/*'] = [
20
            'class' => 'yii\i18n\PhpMessageSource',
21
            'basePath' => '@modules/main/messages',
22
            'fileMap' => [
23
                'modules/main/module' => 'module.php',
24
                'modules/main/backend' => 'backend.php',
25
                'modules/main/frontend' => 'frontend.php',
26
            ],
27
        ];
28
29
        // Rules
30
        $app->getUrlManager()->addRules(
31
            [
32
                // объявление правил здесь
33
                '' => 'main/default/index',
34
                '<_a:(about|contact|captcha)>' => 'main/default/<_a>',
35
            ]
36
        );
37
    }
38
}
39