i have one Application in Yii and want to add one Link to but with Post request.
here is my button code
CHtml::link("<div class=cname1> Copy </div><br>",Yii::app()->createUrl("action/copy", array("id" => $data->id))),
how to make this link as Post ?
sorry i can't use button or some thing cuase its in application and i just want to make this link post.
Thanks
use submit in optionArray
$url = array('controller/action');
CHtml::link(
'label',
$url,
array(
'submit' => $url,
'params' => array('param1' => $data['id1'], 'param2' => $data['id2']),
)
);
In your case
$url = Yii::app()->createUrl("action/copy");
CHtml::link("<div class=cname1> Copy </div><br>", $url,
array(
'submit' => $url,
'params' => array("id" => $data->id))
);