I’m using CSqlDataProvider to use the data in CGridView. However, it seems all the data is in array format - I have to use $data[‘title’]. How to I access a function in the model class? If I wasn’t using CSqlDataProvider I would access the function as $data->getDate(), but how do I do so when arrays are involved and not objects?

See below.

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


	'dataProvider' => $model->search(true),




			'type' => 'raw',

			'name' => 'title',

			'value' => 'CHtml::link($data["title"], array("view", "id" => $data->id))',





			'template' => '{view}',



You probably can use this syntax YourModel::model()->getDate()