I am new to Yii, I have the follwing code, 'columns'=>array(
'id',
'name',
'email',
array(
'name' => 'deleted',
'value' => $model->deleted == 1 ? 'Yes' : 'No',
),
I want to display YES if the deleted field from the database equal 1 or NO if not.
and it keeps giving me a PHP notice : Use of undefined constant Yes.
Thanks in advance.
EDIT My hole wedgit
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'users-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'name',
'email',
array(
'name' => 'deleted',
),
/*
'pass',
'salt',
'first',
'last',
'phone',
'attempts',
'locked',
'gender',
'birth',
'joined',
'updated',
'active',
'reset',
'permission',
'appress',
'deleted',
*/
array(
'class'=>'CButtonColumn',
'template'=>'{view}{ban}',
'buttons' => array(
'ban' => array
(
'label'=> 'Ban User',
'url'=>'Yii::app()->createUrl("users/delete", array("id"=>$data->id))' ,
'click'=>'function(){confirm("Are you sure you want to Ban this ?");}',
),
)
),
),
));