Display image in grid view YII2

In Yii 2 there are many function including built-in helper for building urls. So we can easily bulld the url to image by path too .

To display the image in grid view :

[
   'attribute' ='image',
   'format' ='html',    
   'value' =function($data) {
      return Html::img(\Yii::$app->request->BaseUrl.'/uploads/'.$data->image,['width'=100]);
    },
]

To display the image in DetailView :

[
 'attribute'='image',
 'value'=(\Yii::$app->request->BaseUrl.'/uploads/tips/'.$model->image),
 //'value'=$model->image,
 'format' =['image',['width'='100','height'='100']],
 ],

Pankaj Singh Sugara