\yii\grid\SerialColumn::className()],
[
'attribute' => 'item_image_path',
'format' => 'raw',
'value' => function (Item $model) {
$uploadHelper = UploadHelper::getInstance();
$url= ($model->item_image_path != null && !empty($model->item_image_path)) ? $model->item_image_path : '';
$url = Com::checkExist($url);
return Html::img($url, ['alt'=>'ItemImage','width'=>'60','height'=>'60', 'class' => 'img-responsive img-thumbnail']);
}
],
[
'attribute' => 'item_name',
'headerOptions' => ['style' => 'width:15%'],
'filterInputOptions' => ['class' => 'col-md-12 form-control'],
'value' => function (Item $model) {
return $model->item_name;
}
],
[
'attribute' => 'category_name',
'headerOptions' => ['style' => 'width:10%'],
'filter' => $categoryName,
'filterInputOptions' => ['class' => 'select2 form-control', 'prompt' => 'All'],
'format' => 'raw'
],
[
'attribute' => 'vendor_name',
'headerOptions' => ['style' => 'width:10%'],
'filter' => $vendorName,
'filterInputOptions' => ['class' => 'select2 form-control', 'prompt' => 'All'],
'format' => 'raw'
],
'quantity',
];
?>
= CGridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'id' => 'items',
'columns' => $columns
]); ?>