How To Have Multiple Condition In Value Of Cgridview


How can I have multiple condition in ‘value’, it is ok for 2 value male or female but how to handle more than 2 value ,






For example, instead of M or F … I have custom value like 1-Senior 2-Junior 3-Staff.

try this

'value' =>" $data->gender > 1 ? ( $data->gender ==2 ? 'junior' : 'staff' ) : 'senior'


Is there any possibility to have like multiple if or case way…?

OR at least to match with any model function

I needed to display a field using several conditions to determine the format. I set up a function in models and referenced it in the view as