Answer the question
In order to leave comments, you need to log in
How to set behavior for controllers in a module in Yii2?
I have created a rest api module and I need to assign behaviors to all controllers in this module. The behavior is:
$behaviors['contentNegotiator'] = [
'class' => ContentNegotiator::className(),
'formats' => [
'application/json' => Response::FORMAT_JSON,
],
];
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