Yii2刪除確認對話框不能通過菜單窗口項目工作。Yii2方法不允許。此URL只能處理以下請求方法:POST
[
'label' => '<i class="fa fa-trash-o alis"></i> Sil',
'url' => ['site/delete', 'id' => $model->id],
'linkOptions' => [
'data-confirm' => 'Are you sure you want to delete this item?',
'data-method' => 'post',
],
'visible' => 'visible'
],
而且我看到這個錯誤:
Method Not Allowed (#405) Method Not Allowed. This url can only handle the following request methods: POST.
如何使用刪除確認對話框。然後我嘗試這一點,但沒有工作...
[
'label' => '<i class="fa fa-trash-o alis"></i> delete',
'url' => ['site/delete','id' => $model->id],
[
'data' =>[
'data-confirm' => 'Are you sure you want to delete this item?',
'data-method' => 'post',
],
],
'visible' => 'visible'
],