Commit 1aca89183552f40b33b166bba79f4f44472f83e4
1 parent
9217ef8e
09.02.16
Showing
2 changed files
with
5 additions
and
1 deletions
Show diff stats
common/behaviors/ShowImage.php
@@ -8,6 +8,10 @@ use yii\base\Behavior; | @@ -8,6 +8,10 @@ use yii\base\Behavior; | ||
8 | class ShowImage extends Behavior | 8 | class ShowImage extends Behavior |
9 | { | 9 | { |
10 | function minImg($dir, $width, $height=null){ | 10 | function minImg($dir, $width, $height=null){ |
11 | + if(empty($dir)){ | ||
12 | + return $dir; | ||
13 | + } | ||
14 | + | ||
11 | if($width=='original'){ | 15 | if($width=='original'){ |
12 | $preg = '/\/(.[^\/]*)$/'; | 16 | $preg = '/\/(.[^\/]*)$/'; |
13 | preg_match('/\.(.[^.]*)$/', $dir, $type); | 17 | preg_match('/\.(.[^.]*)$/', $dir, $type); |
frontend/views/performer/_gallery_list_view.php
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | 11 | ||
12 | </div> | 12 | </div> |
13 | <div class="gallery-box-big"> | 13 | <div class="gallery-box-big"> |
14 | - <?php foreach(explode(',', $model->photo ) as $image):?> | 14 | + <?php foreach(explode(',', $model->photo ) as $image): ?> |
15 | <span data-link="<?= $model->minImg($image, 'original'); ?>"></span> | 15 | <span data-link="<?= $model->minImg($image, 'original'); ?>"></span> |
16 | <?php endforeach; ?> | 16 | <?php endforeach; ?> |
17 | </div> | 17 | </div> |