Reputation: 841
I am trying to pass variables through linkButton in Yii, but nothing is reaching my controller.
View:
<?php echo CHtml::linkButton('Approve', array(
'submit'=>array('comment/approve','id'=>$data->id),
'params'=>array('CommentId' => $data->CommentId),
)); ?>
Controller dump: Result is NULL
var_dump($_GET['CommentId']);
die();
What am I missing here?
Upvotes: 0
Views: 2130
Reputation: 2583
Variables passed using the params
option end up in the $_POST
array. You should see CommentId in:
var_dump($_POST['CommentId']);
Upvotes: 1