CButton Url Issue

New to Yii. I have read the docs, browsed the forums…

Essentially I am trying to place a url into the view button:

$this->widget('zii.widgets.grid.CGridView', array(


'columns'=> array(





			array(														  'class'=>'CButtonColumn',



'viewButtonUrl'=>Yii::app()->createUrl("team/index", array("id"=>$data->id)), // id is the team id for $_GET





The label displays fine, the image displays, the URL is blank in the HTML and when I hover the mouse the url defaults to the current page. I am totally stumped. Oh and $data returns an error as a non-object.

I did tests and $dataProvider->data[]->whatever does display the model data so its there.

What am I missing?

The viewButtonUrl has to be a string as a PHP expression that will be evaluated for each row on displaying the grid.

So you have to assign a string:

 'viewButtonUrl'=>'Yii::app()->createUrl("team/index", array("id"=>$data->id))', 

Thanks you!! Worked.