CSqlDataProvider

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(

	'id'=>'yum-sent-messages-grid',

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

	'columns'=>array(

		

		array(

			'type' => 'raw',

			'name' => 'title',

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

		),

		

		array(

			'class'=>'CButtonColumn',

			'template' => '{view}',

		),

	),

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

/Tommy