Using a variable in viewButtonUrl

Hello, I am trying to create a new CButton for a CGridView, but I need to pass a variable as one of GET parameters of the view button url’s, but it doesn’t work, nothing shows up for pid:


$prog_id = $this->pid;

$cbutton = array('class'=>'CButtonColumn',

	'buttons' => array(

	     'viewButtonUrl'=>'Yii::app()->createUrl("/Engines/view", array("id"=>$data["id"],"pid"=>"$prog_id")'

        )

);

The link it creates is “xyz?pid=”, with nothing after the pid=. It works fine when I put a value in there manually, just wondering how to get this to work with a variable. I tried no quotes around the $prog_id and that doesn’t work either. $prog_id definitely contains a value. Thanks.

Hello, I have something like this in my CGridView and it works fine.




array(

	'class'=>'CButtonColumn',			

	'updateButtonUrl'=>'Yii::app()->urlManager->createUrl("bidDetail/update", array("id"=>$data->id, "bidId"=>' .$bidId. '))'

),




I get an error: Parse error: syntax error, unexpected ‘)’

My code is:


$cbutton = array(

        'class'=>'CButtonColumn',                       

        'updateButtonUrl'=>'Yii::app()->urlManager->createUrl("Engine/update", array("id"=>$data->id, "pid"=>' .$prog_id. '))'

);

Nevermind it’s working all of a sudden. I didn’t even change anything. Thanks