I have the following code:
$config = array();
$dataProvider = new CArrayDataProvider($rawData=$model->tasks, $config);
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'columns'=> array(
'id',
'name',
'contents',
array(
'class'=>'CButtonColumn',
'viewButtonUrl'=>Yii::app()->createUrl('Task/view', array('id'=>$data['id'])),
'updateButtonUrl'=>Yii::app()->createUrl('Task/update', array('id'=>$data['id'])),
)
)
));
As far as I can tell this is accurate but I get an error: Undefined variable: data
I did see this post http://www.yiiframework.com/forum/index.php?/topic/9862-cgridview-data-undefined/page__p__48526__hl__CGridView+%24data#entry48526 but as far as I can tell this code should be working