<?php use yii\helpers\Url; use yii\helpers\Html; use s02\photobank\Module; ?> <div class="photo-controls"> <a href="<?php echo Url::to(['photobank/photo/delete', 'id' => $model->id]); ?> " class="js-gallery-photo-delete" data-ask="<?php echo Module::t('photobank', 'are.you.sure'); ?> "> <span class="glyphicon glyphicon-trash "></span> </a> </div> <?php if (in_array($model->extension, ['JPG', 'PNG', 'SVG'])) { ?> <?php echo Html::a(Html::img($model->getThumb()), $model->getThumb(), ['class' => 'photo-link', 'target' => '_blank', 'data-pjax' => 0]); } else { ?> <?php echo Html::a('', $model->getThumb(), ['class' => 'doc-link', 'target' => '_blank', 'data-pjax' => 0, 'title' => $model->getThumb()]); }
<?php use yii\widgets\Pjax; use yii\helpers\Url; use yii\helpers\Html; use yii\widgets\ListView; use s02\photobank\Module; ?> <div class="form-group"> <label><?php echo Module::t('photobank', 'gallery'); ?> </label> <div class="page-gallery"> <?php echo $this->render('_file-input', ['form' => $form, 'tag' => $tag, 'parent_id' => $parent_id]); Pjax::begin(['id' => 'pjax-photobank', 'enablePushState' => false, 'options' => ['class' => 'attacheable-grid']]); echo ListView::widget(['dataProvider' => $dataProvider, 'summary' => '', 'options' => ['class' => 'photo-list'], 'showOnEmpty' => false, 'itemOptions' => ['class' => 'photo-item'], 'itemView' => '_photo', 'id' => $id]); Pjax::end(); ?> </div> </div>