Customize Tbgridview "display Name"

*Database table : File(id, na,e, uploaded_by, …, active);

*"active", the value can be 1 or 0.

In the view: Iam using TbGridView.

How I can display "yes"/"NO" instead of 1/0 in the column "active"?

Thank you.

try:


array(

'name'=>'active',

'value'=>'($data->active ? "yes" : "no")',

        ),

or see: www.yiiframework.com/forum/index.php/topic/7530-transform-a-model-attribute-value/

How about:


array(

    'name'=>'active',

    'type'=>'boolean',

);

@gstar +1 for this is the right way of doing it


array(

    'name'=>'active',

    'type'=>'boolean',

);

You can do something like this in columns section of gridview:

array(‘header’=>‘Is Active’, ‘value’=>’$data[“active”]==1?“Yes”:“No”’),