How to put an image in GridView in yii2?I have the following code. But its not displaying the image as it is not giving any image url. Where to put the image url?
<?php echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'c_id',
'name:ntext',
'description:ntext',
array(
'format' => 'image',
'attribute'=>'logo',
),
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
In views->image->index.php
In model->image
table attributes are, image_id,image_path,caption1,caption2,status
I used to use 'raw' format for this type of work.
if image exists then image is displayed otherwise it is blank.