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?
Try like,
array( 'format' => 'image', 'value'=>function($data) { return $data->imageurl; }, ),
And in your model,
public function getImageurl() { return \Yii::$app->request->BaseUrl.'//'.$this->logo; }
Don't know this is the right way or not.But this works for me.