Passed
Push — master ( e5a117...444e05 )
by Paweł
09:40
created

Module::behaviors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
namespace app\modules\admin;
4
use Yii;
5
use yii\filters\AccessControl;
6
7
/**
8
 * admin module definition class
9
 */
10
class Module extends \yii\base\Module
11
{
12
    public $layout = 'main';
13
14
    /**
15
     * @inheritdoc
16
     */
17
    public $controllerNamespace = 'app\modules\admin\controllers';
18
19
    public function behaviors()
20
    {
21
        return [
22
            'auth' => [
23
                'class' => AccessControl::class,
24
                'except' => ['auth/*'],
25
                'rules' => [
26
                    [
27
                        'allow' => true,
28
                        'roles' => ['@']
29
                    ]
30
                ],
31
            ],
32
        ];
33
    }
34
35
    /**
36
     * @inheritdoc
37
     */
38
    public function init()
39
    {
40
        parent::init();
41
42
        Yii::$app->homeUrl = '/admin/monitoring/accounts';
43
    }
44
}
45