Answer the question
In order to leave comments, you need to log in
How to solve problem with ActiveController in yii2 doesn't resolve options method?
There is a standard controller inherited from ActiveController;
URLManager:
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => false,
'showScriptName' => false,
'rules' => [
['class' => 'yii\rest\UrlRule', 'controller' => 'user-product'],
],
],
Answer the question
In order to leave comments, you need to log in
Derivate from it and override the method:
/**
* {@inheritdoc}
*/
protected function verbs()
{
return [
'index' => ['GET', 'HEAD', 'options'],
'view' => ['GET', 'HEAD'],
'create' => ['POST'],
'update' => ['PUT', 'PATCH'],
'delete' => ['DELETE'],
];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question