Exemplo n.º 1
0
 public function beforeSave($insert)
 {
     $uploadedFile = Common::uploadFile('Fragment2Data[thumb]');
     if ($uploadedFile['message'] === 'ok') {
         $this->thumb = $uploadedFile['full_name'];
     }
     return parent::beforeSave($insert);
 }
Exemplo n.º 2
0
 public function beforeSave($insert)
 {
     $uploadedFile = Common::uploadFile('Fragment2Data[thumb]');
     if ($uploadedFile != null) {
         $this->thumb = $uploadedFile['url'] . $uploadedFile['new_name'];
     }
     return parent::beforeSave($insert);
 }