Exemplo n.º 1
0
 /**
  * Process elements value from request
  *
  * @return
  */
 public function result()
 {
     $file = new File_Upload($this->options);
     if ($result = $file->upload()) {
         $this->is_fetched = TRUE;
         $result = File::pathToUri($result->path, UPLOADS);
     } else {
         $this->errors = $file->getErrors();
     }
     if (cogear()->input->post($this->name)) {
         return '';
     }
     if ($this->validate()) {
         if ($result) {
             return $result;
         }
         return $this->errors ? FALSE : NULL;
     }
     return FALSE;
 }