diff --git a/views/default/galleryItem.php b/views/default/galleryItem.php index be91bf8..b4a459f 100644 --- a/views/default/galleryItem.php +++ b/views/default/galleryItem.php @@ -38,7 +38,7 @@ $model->gallery_id]) ?>"> galleryPhotos as $prevPhoto){ - echo \yii\helpers\Html::img('/img/gallery/' . Translator::rus2translit($model->name) . '/thumb/' . $prevPhoto->name); + echo \yii\helpers\Html::img(Yii::getAlias('@web') . '/img/gallery/' . Translator::rus2translit($model->name) . '/thumb/' . $prevPhoto->name); }; ?> diff --git a/views/default/view.php b/views/default/view.php index 7264955..6cd7598 100644 --- a/views/default/view.php +++ b/views/default/view.php @@ -22,11 +22,11 @@ $this->registerJs(<< 'gallery-view']); @@ -47,8 +47,8 @@ foreach ($photos as $photo) { $items[] = [ - 'original' => '/img/gallery/' . Translator::rus2translit($galleryName) . '/' . $photo->name, - 'thumbnail' => '/img/gallery/' . Translator::rus2translit($galleryName) . '/thumb/' . $photo->name, + 'original' => Yii::getAlias('@web') . '/img/gallery/' . Translator::rus2translit($galleryName) . '/' . $photo->name, + 'thumbnail' => Yii::getAlias('@web') . '/img/gallery/' . Translator::rus2translit($galleryName) . '/thumb/' . $photo->name, 'options' => [ 'title' => $galleryName, 'data-id' => $photo->photo_id, @@ -152,6 +152,7 @@ }); inputField.on('fileunlock', function(event, data, previewId, index) { + inputField.fileinput('upload'); location.reload(); }); });