Completed
Push — master ( 89be15...80fd60 )
by Igor
11:15
created

IndexController::behaviors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace app\modules\profile\controllers;
4
5
use Yii;
6
7
class IndexController extends \yii\web\Controller
8
{
9
    public function behaviors()
10
    {
11
        return [
12
            'verbs' => [
13
                'class' => 'yii\filters\VerbFilter',
14
                'actions' => [
15
                    'logout' => ['post'],
16
                ],
17
            ],
18
        ];
19
    }
20
21
    public function actionLogout()
22
    {
23
        Yii::$app->user->logout();
24
        return $this->redirect(['/']);
25
    }
26
}
27