更新时间:2022-06-27 07:06:04
之所以发生这种情况,是因为它不是发布请求. CHtml::link
提供了一种使用post方法而不是get的方法.这要求您在clientChange
的submit
属性>.
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?'
)
);