Answer the question
In order to leave comments, you need to log in
How to connect ContentNegotiator?
I want to connect the ContentNegotiator to determine the language in the restful api.
My config
'bootstrap' => [
[
'class' => 'yii\filters\ContentNegotiator',
'formats' => [
'application/json' => Response::FORMAT_JSON,
'application/xml' => Response::FORMAT_XML,
],
'languages' => [
'ru',
'en',
],
],
],
Accept-Language: ru
Yii::$app->language;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question