Answer the question
In order to leave comments, you need to log in
How to change filter value in gridview from 1 to 'YES'?
conclusion_top is 0.1
['attribute' => 'conclusion_top',
'filter'=> \yii\helpers\ArrayHelper::map(\backend\models\Alaniatape::find()->all(),'conclusion_top', 'conclusion_top'),
'value' => function ($data) {
return $data->conclusion_top ? '<span class="text-success"><i class="glyphicon glyphicon-ok"></i></span>' : '<span class="text-danger"><i class=" glyphicon glyphicon-remove"></i></span>';
},
'format' => 'raw'],
Answer the question
In order to leave comments, you need to log in
You should have in the filter what is in
If you need yes and no, then you should probably do this:
[
'attribute' => 'conclusion_top',
'filter'=> [0=>'нет', 1=>'да']
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question