Hi everyone!
Below is my code.
product/index.php
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'label'=>'Selling Price',
'attribute'=>'prod_sell_price',
'format'=>['decimal',2],
],
// 'prod_compare_price',
'prod_active',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
Would like to know :
-
Can we use some condition in gridview? For example: instead of showing prod_active (1 or 0), can we make it like if prod_active == 1, echo ‘Selling’ in the field, if prod_active == 0, echo ‘On-Hold’ in the field?
-
Can we make selling price column showing something like 13.00 10.00 (prod_compare_price prod_sell_price)?
Thank you in advance