Cgridview Unable To Format Data

Hi, I’ve a date in varchar data type format of yyyymmdd

for some reasons, I can’t convert it to a readable format => D, d M Y H:i:s

What did I miss?


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

	'id'=>'flowbook-grid',

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

	'filter'=>$model,

	'columns'=>array(

		array(

			'name' => 'create_time',

			'value' => $this->convertTime($model->create_time), //it displays the original value of 

                                                                            //yyyymmdd but does not convert it

		),

	),	

)); ?>

‘value’ must be evaluated on every row, not on grid definition.

you should change it to something like:




'value' => 'Yii::app()->controller->convertTime($data->create_time)',



It works! thanks.

But where did the $data come from?

$data is mapped to every row in internal loop which renders grid content. there is also similar $row variable available which is a numerical row number.