Answer the question
In order to leave comments, you need to log in
Why don't my actions work in yii2 rest?
Their actions do not work, "Not Found (#404)" is returned, while the standard ones from ActiveController work
Settings urlManager
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'rules' => [
[
'class' => 'yii\rest\UrlRule',
'controller' => ['user', 'order', 'product'],
'pluralize' => false,
],
],
],
class ProductController extends BaseApiController
{
public $modelClass = 'frontend\models\rest\Product';
public function actionSome(){
return ['some text'];
}
}
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