1 | <?php |
||
2 | /** |
||
3 | * @author Anton Tuyakhov <[email protected]> |
||
4 | */ |
||
5 | |||
6 | namespace tuyakhov\jsonapi; |
||
7 | |||
8 | |||
9 | use yii\filters\ContentNegotiator; |
||
10 | use yii\helpers\ArrayHelper; |
||
11 | use yii\web\Response; |
||
12 | |||
13 | class Controller extends \yii\rest\Controller |
||
14 | { |
||
15 | public $serializer = 'tuyakhov\jsonapi\Serializer'; |
||
16 | |||
17 | /** |
||
18 | * @inheritdoc |
||
19 | */ |
||
20 | public function behaviors() |
||
21 | { |
||
22 | return ArrayHelper::merge(parent::behaviors(), [ |
||
23 | 'contentNegotiator' => [ |
||
24 | 'class' => ContentNegotiator::className(), |
||
0 ignored issues
–
show
|
|||
25 | 'formats' => [ |
||
26 | 'application/vnd.api+json' => Response::FORMAT_JSON, |
||
27 | ], |
||
28 | ] |
||
29 | ]); |
||
30 | } |
||
31 | |||
32 | } |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.