Hi,
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 ,
array(
'name'=>'column_name',
'type'=>'HTML',
'value'=>'($data->gender=="M")?"Male":"Female"',
),
For example, instead of M or F … I have custom value like 1-Senior 2-Junior 3-Staff.
ahmed201
(Rifajas)
2
try this
'value' =>" $data->gender > 1 ? ( $data->gender ==2 ? 'junior' : 'staff' ) : 'senior'
"
logudotcom
(Logudotcom)
3
Is there any possibility to have like multiple if or case way…?
logudotcom
(Logudotcom)
4
OR at least to match with any model function
richmest
(Richard Mestetsky)
5
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
'value'=>'$data->reformat_UID($data->Owner_uid)'