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;
 }
示例#2
0
 /**
  * Image validator: is file image?
  * @return bool
  */
 public static function validateImage(UploadControl $control)
 {
     $file = $control->getValue();
     return $file instanceof HttpUploadedFile && $file->isImage();
 }