나는 mysql에 저장된 이미지의 축소판을 보여주는 gridview가 있습니다. 클릭했을 때 이미지를 팝업으로 표시해야합니다. Yii2 팝업 이미지에서 팝업 이미지 클릭 이미지
이
이 의 index.php![enter image description here](https://i.stack.imgur.com/qELuB.png)
내있는 gridview의 전망이며,이 코드입니다 [업데이트] 그 때 나는 팝업으로 해당 이미지를 표시 할 수 있습니다 어떻게
<?php
<div class="license-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Create License', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?=
GridView::widget([
'filterModel' => $searchModel,
'dataProvider' => $dataProvider,
'pjax' => true,
'pjaxSettings' => [
'neverTimeout' => true,
'options' => [
'id' => '-pjax',
'enableReplaceState' => false,
'enablePushState' => false,
],
],
'columns' => [
['class' => 'yii\grid\SerialColumn',
'header' => 'No',
'options' => [
'width' => '10px',
],
],
'company',
'address',
[
'attribute' => 'bukti',
'value' => function ($data) {
return Html::a(Html::img(Yii::getAlias('@web') . '/file/' . $data->bukti, ['alt' => 'some', 'class' => 'fancy-box', 'height' => '100px', 'width' => '100px']), ['site/zoom']);
},
'format' => ['raw'],
],
['class' => 'yii\grid\ActionColumn'],
],
]);
?>
</div>
<?php
$this->registerJs('jQuery(document).ready(function(){
jQuery("a.fancy-box").fancybox();
});');
?>
클릭하셨습니까?
감사
작동하지 않았습니다. 이미지를로드 할 수 없습니다. – Blackjack
이 메시지는 어디에 나타 났습니까? –