Parameter Pass As Post Use Link

How to multiple parameter pass as post by using CHtml::link and get parameter value from controller action ?

Like as

$url = array(‘Exams/displaySubject’);

echo CHtml::link(

    $val['exam_groups_name'], $url, array(


        'submit' => $url,


        'params' => array('exam_groups_id' => $val['exam_groups_id'], 'batch_id' => $val['batch_id']),


            )

);

But i can’t understand is it working ? Because I can not get parameter value in controller action. if it is right code then how to get parameter value from controller action ? So help any one plz. solve the problem ?

Dear Friend

I am finding no problems.

I just give my logic.

views/test/one.php




echo CHtml::link("submit",array("test/three"),array(

        'submit'=>array("test/three"),

        'params'=>array('name'=>'seenivasan'),

));



TestController.php




public function actionThree()

	{

		echo $_POST['name'];

	}



I have tested your code it works fine


<?php

echo CHtml::link($val['exam_groups_name'], $url, array(

	'submit' => array('Exams/displaySubject'),

	'params' => array('exam_groups_id' => $val['exam_groups_id'], 'batch_id' => $val['batch_id']),

));

?>

Dear Friends ,

Thanks for reply. I had another problem. Now it is working.

Dear Friend

You are not having any controller named TestController.

Try The following.




echo CHtml::link("submit",array("test/three"),array(

'submit'=>array("monthlyPayslips/three"),

'params'=>array('name'=>'seenivasan'),

));



Hi Saimon,

I am having problems with reading the POST variables in my controller and would appreciate it if you could share some of your code from the "displaySubject" function.

Thank you.

Regards,

Andy.