rymonator
(Ryan Bobrowski)
January 14, 2011, 7:26pm
1
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.
re1nald0
(Reinld17)
January 15, 2011, 6:06am
2
rymonator:
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. '))'
),
rymonator
(Ryan Bobrowski)
January 17, 2011, 2:51pm
3
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. '))'
);
rymonator
(Ryan Bobrowski)
January 17, 2011, 4:14pm
4
rymonator:
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