Hello,
I get the following error when running the code below:
PHP notice
Undefined variable: data
Here is my code (from my view file)
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProviderUsers,
'columns'=>array(
'name',
'research_interests',
array(
'header'=>'Select a time to meet',
'template'=>'{time1}{time2}{time3}',
'buttons' => array(
'time1' => array(
'label'=>$timeSlots[0],
'url' => "Yii::app()->createUrl('/meeting/create', array('id'=>$data->id, 'time'=>'time1'))",
),
'time2' => array(
'label'=>$timeSlots[1],
'url' => "Yii::app()->createUrl('/meeting/create', array('id'=>$data->id, 'time'=>'time2'))",
'options'=>array( 'class'=>'timeButton'),
),
'time3' => array(
'label'=>$timeSlots[2],
'url' => "Yii::app()->createUrl('/meeting/create', array('id'=>$data->id, 'time'=>'time3'))",
'options'=>array( 'class'=>'timeButton'),
)
)
),
),
));
I read the following topic but it did not help me:
http://www.yiiframework.com/forum…
Why can’t I used the $data variable in the URL of my custom buttons for my CDataColumn grid column instance?
Thanks.