更新时间:2022-01-28 07:34:36
发生这种情况是因为它不是发布请求.CHtml::link
有一种方法可以使用 post 方法,而不是 get.这需要您使用 clientChange
的 submit
属性>,在你的 htmlOptions
中.
This is happening because it's not a post request. CHtml::link
has a way by which you can use post method, instead of get. This requires you to use submit
attribute of clientChange
, in your htmlOptions
.
有点像这样:
echo CHtml::link(CHtml::encode('Delete image'), array('image/delete', 'id'=>$image->id),
array(
'submit'=>array('image/delete', 'id'=>$image->id),
'class' => 'delete','confirm'=>'This will remove the image. Are you sure?'
)
);