xav3
(Gzav)
1
Description of a column in CGridView
array(
'name'=>'Public/Private',
'type'=>'text',
'value'=>'($data->public)' ? 'Public':'Private',
),
returns the following error
Parse error: parse error in D:\xampp\htdocs\yii\framework\base\CComponent.php(616) : eval()'d code on line 1
mdomba
(Maurizio Domba Cerin)
2
because ‘value’ is evaluated… you have to put all your “code” as an string expression like
'value'=>' ($data->public) ? "Public":"Private" ',
Note that all the expression is as one string.
mikl
(Mike)
3
You should write:
'value'=>'$data->public ? "Public" : "Private"',
The way you wrote it, ‘($data->public)’ was evaluated to true, so it was like saying:
'value'=>'Public',
EDIT: Hehe, mdomba was faster again 
xav3
(Gzav)
4
Sorry, you’re right. Thank you guys. It works.
Love Yii !