Yii:CHtml::ajaxLink方法在URL format为path情况下的多参数传递示例

URL配置:

	'urlManager' => array(
		'class' => 'application.base.Url',
	        'urlFormat' => 'path',
	        'showScriptName' => false,
	        'rules' => array(
	        ),
	),

视图代码:

    echo CHtml::ajaxLink('delete', array('/Social/comment/delete', 'id'=>$data->Id, 'type'=>'brief', 'key'=>$data->fkey), array(
                'success'=>'function(){
                    $("#comment-'.$data->Id.'").remove();
            }',
            'type'=>'POST',
    ), array(
            'id'=>'delete-comment-'.$data->Id,
            'confirm'=>'are u sure?',
    ));

控制器:

    public function actionDelete($id,$type,$key) {
	echo 'techbrood.com demo: '.$id.$type.$key;
    }


by iefreer

你可能感兴趣的:(yii,Path,多参数,CHtml,ajaxLink)