这是我的网格视图,我从类更改actionColumn
为:
[ 'format' => 'html',
'contentOptions'=>['style'=>'width: 5px;'],
'value' => function($model) {
if($model->id == Yii::$app->user->identity->id) {
return Html::a('<i class="glyphicon glyphicon-share-alt"></i>').' '.
Html::a('<i class="glyphicon glyphicon-pencil"></i>', ['update', 'id' => $model->id]).' '.
Html::a('<i class="glyphicon glyphicon-trash"></i>', ['delete', 'id' => $model->id], ['data' => ['confirm' => 'Do you really want to delete this element?','method' => 'post']]);
}
return '';
},
],
这给了我一个错误。
Method Not Allowed (#405)
Method Not Allowed. This url can only handle the following request methods: POST.
当我actionColumn
再次更改为它时它正在工作,但是我更改了代码,它只是给了我一个错误。