Hello, I am new user Yii.
As always if we want to create the simple conditions of use if in the introduction of the value.
This code below I put in my model.
public function statusCabang($i)
{
if($i==1)
return "Perhitungan Lembur Staff: Gaji + Tunjangan";
else if($i==2)
return "Perhitungan Lembur Non Staff: Gaji + Tunjangan";
else
return " ";
}
This code below I put in my admin view files.
array(
'header' => 'Pilihan-pilihan',
'value'=>'Cabang::model()->statusCabang($data->pilihan)',
),
Q:
1.How to use my function with value like 1, 2 ?
2.whether playing in these conditions should be in GridView? On List View?