MaintenanceController::behaviors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace dominus77\maintenance\controllers\frontend;
4
5
use yii\web\Controller;
6
use yii\filters\VerbFilter;
7
use dominus77\maintenance\actions\frontend\IndexAction;
8
use dominus77\maintenance\actions\frontend\SubscribeAction;
9
10
/**
11
 * Class MaintenanceController
12
 * @package dominus77\maintenance\controllers\frontend
13
 */
14
class MaintenanceController extends Controller
15
{
16
    /** @var string */
17
    public $viewPath;
18
19
    /**
20
     * @return array
21
     */
22
    public function behaviors()
23
    {
24
        return [
25
            'verbs' => [
26
                'class' => VerbFilter::class,
27
                'actions' => [
28
                    'subscribe' => ['POST'],
29
                ]
30
            ]
31
        ];
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function actions()
38
    {
39
        return [
40
            'index' => [
41
                'class' => IndexAction::class,
42
                'viewPath' => $this->viewPath
43
            ],
44
            'subscribe' => [
45
                'class' => SubscribeAction::class
46
            ]
47
        ];
48
    }
49
}
50