CostaRico / yii2-images

Yii2-images - behavior-based module for resizing, storing, caching and attaching images.
160 stars 98 forks source link

Not showing images on view page after yii2 update #90

Open rustam-mukhametshin opened 5 years ago

rustam-mukhametshin commented 5 years ago

In src of image url /yii2images changes into /somedigit, after yii2 latest update.

If patch wont be accepted, and if you dont want to create own package, feel free to use/modify this code.

function fixImages($string) { $replacement = '/yii2images/images/'; $pattern = preg_match('/placeHolder/', $string) ? '/\/images\//' : '/\/(\d+)\/images\//'; return preg_replace($pattern, $replacement, $string); }

I.e. fixImages($model->getImage()->getUrl()) or with getImages

Sorry for my English, and my php experience.