resizeImg($width, $height, $original, $filename); } else { $imageNotFound = yii\helpers\Url::to('@storage')."/imageNotFound".$width."x".$height.".jpg"; if(!file_exists($imageNotFound)){ $resizer->resizeImg($width, $height, yii\helpers\Url::to('@storage')."/imageNotFound.jpg", $imageNotFound ); } return "/storage/imageNotFound".$width."x".$height.".jpg"; } } } } return $dir; } /** * @param string $array String to split * * @return array Array of image paths */ function ShowGallery($array) { $gallery = explode(',', $array); if(is_array($gallery)) { array_splice($gallery, -1); return $gallery; } else { return [ ]; } } public function ShowAvatar($dir, $width, $height = NULL) { if(empty($dir)) { return '/images/avatar-bg.png'; } else { return $this->minImg($dir, $width, $height); } } }