Concatenate Column Value In A Single View In Yii

Can anyone help me in displaying two column value in a single view? Example: I have two column named unit and department. On my view, I want to display like Unit/Department == Unit1, Department1. Instead of displaying it individually, I would want to just concatenate their value. I believe that it is in _view.php. Any answers are accepted. Thank you :)

Hi adrianna

Do you want to concatenate the values in CGridview (or CListView) ?

  1. In CGridview




'header'=>'Two values',

'value'=>'$data->Unit1 . $data->Department1',




  1. In _view.php just

echo $data->Unit1 . $data->Department1

Thank you KonApaz. :D It works!