My database column "status" stores "0 or 1" value but I want to display "Enable" or "disable"
Asked
Active
Viewed 122 times
1 Answers
0
Try this... This might be helpful to you.
Modify code as per your need.
[
'attribute' => 'status',
'value' => function ($model, $key, $index, $widget) {
if ($model->status == 0) {
$status = 'disable';
} elseif ($model->status == 1) {
$status = 'Enable';
} else {
$status = 'Completed';
}
return $status;
}
]

vijay nathji
- 1,608
- 13
- 23
-
i want one more help yii2-jui not install i can getting this error "yiisoft/yii2-jui 2.0.0 requires bower-asset/jquery-ui 1.11.*@stable -> no matching package found." so can you help me ?? – Hothi Jimit May 20 '16 at 05:32
-
Yes I have a solution for that also.. Please Ask A new question will give answer there. And Please accept above answer if it was helpful to you. Thanx. – vijay nathji May 20 '16 at 05:38
-
-
one more question about yii2 alredy post question in yii2 advanced – Hothi Jimit May 20 '16 at 12:40
-
Didn't get your question bro.. Do you have query regarding yii2 advanced.? – vijay nathji May 21 '16 at 04:33
-
yes bro http://stackoverflow.com/questions/37346499/how-multiple-row-delete-using-checkbox-in-yii2/37371524#37371524 this question – Hothi Jimit May 23 '16 at 06:39