Hi guys, I have a problem when I created CButtonColumn just to using view.
Here’s my code :
<?php $this->widget('zii.widgets.grid.CGridView', array(
'itemsCssClass'=>'table table-striped table-bordered table-hover',
'id'=>'Search-grid',
'dataProvider'=>$data->getList(),
//'filter'=>$model,
'columns'=>array(
'username',
'name',
'address',
array('header'=>'Options','class'=>'CButtonColumn',
'viewButtonUrl'=>'Yii::app()->controller->createUrl("/task/view",array("id"=>$data["id"]))',),
),
));
?>
When I ran it, it show error.
Trying to get property of non-object
error : eval()'d code(1)
I’ve tried to solve it. I used source code like this :
array('header'=>'Options','class'=>'CButtonColumn',
'template'=>'{view}',),
But it still showed error result again.
I hope anybody help me.