Modify content in CGridView ?

Is there anyway to make it cleaner and not let it use eval?


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

	'dataProvider'=> $dataProvider,







            'name' => 'description',

            'value' => 'CString::truncate($data->description)',






)); ?>

What is going to happend where there is some php code in description :s

Is there any benefit over just using a foreach loop which makes the code much more readable?

Nothing. Not $data->description will get eval’ed but only the code you wrote that uses this variable.