200) { $width = 200; } if ($height <= 0 || $height > 200) { $height = 200; } if (!$pointId) { App::error404(); } $point = Point::model()->getByPK($pointId); if (!$point) { App::error404(); } $photos = $point->photos; $img = array_shift($photos); if ($img) { $photo = $photo = App::getBasedir().'../public/'.'photos/'.$img->name; } else { $photo = $photo = App::getBasedir().'../public/'.'img/noPhoto.png'; } if (!file_exists($photo)) { $photo = $photo = App::getBasedir().'../public/'.'img/noPhoto.png'; } Image::createCustomSize($photo, $width, $height); // print $photo; } }