public static function validateImage(UploadControl $control) { $files = $control->getValue(); foreach ($files as $file) { if ($file instanceof Http\FileUpload && $file->isImage()) { } else { return false; } } return true; }
/** * Image validator: is file image? * @return bool */ public static function validateImage(UploadControl $control) { $file = $control->getValue(); return $file instanceof HttpUploadedFile && $file->isImage(); }