我在yii中更新頁面時出現錯誤400。我沒有改變毛病的錯誤400:Yii
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('@'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('@'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
'postOnly + delete', // we only allow deletion via POST request
);
}
我也啓用了urlmanager的URL格式的任何accessRules():
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'<action>'=>'site/<action>'
),
),
我仍然得到錯誤400只爲我的一個模塊,並無法弄明白。
我已經添加了複合主鍵到我的數據庫很久了,錯過了檢查CRUD的功能。我想問題是「複合鍵」。
在main.php中啓用了模塊嗎? – Anri
是的,它被啓用 – user3496974