Не пойму почему не работает.
Контроллер:
Код: Выделить всё
<?php
namespace app\controllers;
use yii\rest\ActiveController;
use yii\data\ActiveDataProvider;
use app\models\Feedback;
class FeedbackController extends ActiveController
{
public $modelClass = 'app\models\Feedback';
public function actions()
{
$actions = parent::actions();
// disable the "delete" and "update" actions
unset($actions['delete'], $actions['update'], $actions['options']);
return $actions;
}
}
?>
// RULES CONFIG:
<?
'rules' => [
['class' => 'yii\rest\UrlRule', 'controller' => ['feedback','comments']],
'<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',
'<_c:[\w\-]+>' => '<_c>/index',
'<_c:[\w\-]+>/<_a:[\w\-]+>/<id:\d+>' => '<_c>/<_a>',
],
?>
Код: Выделить всё
<response>
<name>Method Not Allowed</name>
<message>
Method Not Allowed. This url can only handle the following request methods: GET, HEAD.
</message>
<code>0</code>
<status>405</status>
<type>yii\web\MethodNotAllowedHttpException</type>
</response>