Link to img in gridview

Hello,

please one little help. In gridview there is an image field:


'attribute' => 'photo',

'format' => 'image',

'value' => function($data) { return '/' . $data->thumb ; },

'contentOptions' => ['class' => 'thumb-img']

How it can be possible setting a linkable img ?


<a class"some-other-class" href="$data->full_image">

  <img src="$data->thumb" />

</a>




'attribute' => 'photo',

'format' => 'raw',

'value' => function($data) {

    return Html::a(Html::img($data->thumb), $data->full_image);

},

'contentOptions' => ['class' => 'thumb-img']



Thank you, works fine. Only one more info, please. It is possible to set a different/additional class only for the link and open this in new page (_blank) ?


return Html::a(Html::img($data->thumb), $data->full_image), myclass, _blank;

Sure. Check API of Html::a.

Thank you Samdark.


			[

				'attribute' => 'photo',

				'format' => 'raw',

				'value' => function($data) {

			    	    return Html::a(Html::img('/' . $data->thumb), '/' . $data->maximg,

			    	    [

			    		'class' => 'thumb-img',

			    		'target' => '_blank',

			    		'data-lightbox' => '$data->maximg'

			    	    ]);

				},

			],