我正在尝试使用$data->id
onTbButtonColumn
但出现错误"Trying to get property of non-object"
。工作TbGridView
正常!我做错了什么?
查看.php:
<?php $this->widget('bootstrap.widgets.TbGridView',array(
'type'=>'striped bordered condensed',
'id'=>'profiles-grid',
'dataProvider'=>$dataProvider,
'columns'=>array(
'id',
array(
'class'=>'bootstrap.widgets.TbButtonColumn',
'template'=>'{create}',
'buttons'=>array
(
'create' => array(
'label'=>'Criar Evento',
'icon'=>'plus',
'url'=>'Yii::app()->controller->createUrl("events/create", array("id"=>$data->id))', // Problem here on $data->id
),
),
),
),
)); ?>