CGridView custom column value

How to make a custom column value made ​​up from the value of two columns. Instead I have two columns (REQ_Due and REQ_DatePaid) I want to merge them into one column. The ‘header’ is not problem, but ‘value’ it is for me.


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

		'id'=>'requests-grid2',

		'dataProvider'=>$dataProvider2,

	 	'cssFile'=> Yii::app()->baseUrl.'/css/myGridView2.css',

	 	'htmlOptions' => array('class' => 'grid-view2'),

		'filter'=>$model,

		'columns'=>array(

			'REQ_ID',

			'USER_ID',

			'REQ_RequestDate',

			'REQ_DescriptionText',

	 		'REQ_Beneficiary',

			//'REQ_Due',

	 		array(

	 		'name'=>'REQ_Due',

	 		'header'=>'Due <br/> Paid',

	 		'value'=>'$data->REQ_Due  <<< WHAT I HAVE TO WRITE HERE TO HAVE REQ_DatePaid too>>>',

	 		),

                        'REQ_DatePaid',

                        array(

				'class'=>'CButtonColumn',

			),

		),

	));

You can use




...

'type'=>'raw',

'value'=>'$data->REQ_Due . "<br/>" . $data->REQ_DatePaid',

...



Thanks mdomba! It helps. However the <br/> is part of text (not HTML tag), so my field value is eg. "17.04.2011<br/>18.04.2011"

Do you have solution for this? Thanks!

have you put the ‘type’=>‘raw’ ?

This is solution! Thanks! I forgot about ‘type’=>‘raw’ !