Do i config CDataColumn in CGridView wrong?

Hi all,

I try to convert int data to string in CGridView and this is my codes.

// view

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









			'value'=> ($model->getStatus($data->status))





// model

class Administrator extends CActiveRecord



	public function getAllStatus()


		return array(


			1=>"Member" ,





	public function getStatus($status)


		$array  = self::getAllStatus();

		return $array[$status];



in Status column, it shows nothing. what i do wrong?

someone help, thanks.

The value of the value property should be enclosed in quotes, check the docs -

btw, when you post code… please use the code button (<> on the editor toolbar) so that the code is more readable

And welcome to the yii forum

Sorry for code format.

Now i found a solution. just inherit __get function

but i think it not good way.

I don’t understand what you mean with inherit __get…

you just need to put the expression in a string… like:


Got it.

Thanks a lot. :lol: