I am newbie at yii. I would be thankful if someone could help me.
I am trying to change CGridView column’s value:
'name' => 'fruit',
'filter'=> array("1" => 'Apple', "2" => 'Banana'),
'value' => (('$data->fruit'=="1")?"Apple":"Banana")
Problem is that it still shows me number 1 or 2… (while filter is working)
'value' => '(($data->fruit=="1")?"Apple":"Banana")'
'value' => '$data->fruit=="1"?"Apple":"Banana"'
tri is right, value is an 'eval’uated expression, so it must be a string
I know I’m right about the string, but that doesn’t mean it will fix all his problems whatsoever. We’ll have to wait for reported results.
Thank you guys, you were right. Both variants worked for me.