How to remove a bug in yii2 when you delete?

When deleting in yii2 using GRUD I get an error failed to validate the transmitted data. BUT when you repeatedly click in the address bar ENTER the removal work. What's the matter ?
July 4th 19 at 23:51
1 answer
July 4th 19 at 23:53
Passed POST. Definitely need a CSRF request. If Yii it could not verify out this error.
How, then, should look like a query? - mateo_Polli commented on July 4th 19 at 23:56
To clean the filter, check on the POST and it should work. If you need validation, then you need to watch the code as You have it organized the removal request.

return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
]; - gino commented on July 4th 19 at 23:59
: I have exactly the same. - mateo_Polli commented on July 5th 19 at 00:02
To eliminate need... - gino commented on July 5th 19 at 00:05
: I removed this from the controller but error is still popping up. - mateo_Polli commented on July 5th 19 at 00:08
$model->id] [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'are you sure You want to delete this item?',
'method' => 'post',
],
]) ?>

GET to do, that's not understandable. - gino commented on July 5th 19 at 00:11
: thanks for the replies, I turned off the comp tomorrow I will try, I will write if anything... Thanks - mateo_Polli commented on July 5th 19 at 00:14
In it worked, but the index does not. I went to widget ActionColumn.

if (!isset($this->buttons['delete'])) {
$this->buttons['delete' ] = function ($url, $model, $key) {
$options = array_merge([
'title' => Yii::t('yii', 'Delete'),
'aria-label' => Yii::t('yii', 'Delete'),
'data-confirm' => Yii::t('yii', 'You sure ?'),
'data-method' => 'get',
'data-pjax' => '0',
], $this->buttonOptions);
return Html::a(", $url, $options);
};
}

But I don't know how to enter the second parameter 'id' - mateo_Polli commented on July 5th 19 at 00:17
I answered the question, the decision said. Then it's either another issue, or work for pay. - gino commented on July 5th 19 at 00:20

Find more questions by tags Yii