Completed
Push — master ( b72490...247b5c )
by Alexey
02:24
created

MessageController::actionIndex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace api\modules\v1\controllers;
4
5
use yii\rest\Controller;
6
use api\modules\v1\models\Message;
7
8
/**
9
 * Class MessageController
10
 * @package api\modules\v1\controllers
11
 */
12
class MessageController extends Controller
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    public function behaviors()
18
    {
19
        $behaviors = parent::behaviors();
20
21
        // Add CORS filter
22
        $behaviors['corsFilter'] = [
23
            'class' => \yii\filters\Cors::className(),
24
        ];
25
        
26
        return $behaviors;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function actionIndex()
33
    {
34
        $model = new Message();
35
        return $model->message;
36
    }
37
}
38