あなたのデータ提出を確認することができません:yii2すると、削除のGridView:私はGridViewの上のアイテムを削除したい場合は、私はこのエラーを取得する
exception 'yii\web\BadRequestHttpException' with message 'Unable to verify your data submission.
私のこの私のコントローラのコード:
class DevisController extends Controller
{
public $layout = 'lay-admin';
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/* ..... */
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
そして、私は、このエラーに
Method Not Allowed. This url can only handle the following request methods: GET.
GridViewのコードを取得する行動関数のgetメソッドにPOSTメソッドを変更します。
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
//'idDevis',
'reference',
'client',
'dateCreation',
'contact',
'valableJusqua',
'dateRelance',
[
'attribute'=>'etat',
'filter'=>ArrayHelper::map(Devis::find()->asArray()->all(), 'etat', 'etat'),
],
'commercial',
'modePaiement',
'delaiPaiement',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
ご意見ください!
ビューにCSRFパラメータがありますか? – Bizley
私はこのパラメータを見ることができません。 –
このメソッドは「メソッドが許可されていません。このURLは次のリクエストメソッドしか処理できません:POST.' –