示例#1
0
 /**
  * Upload iconpath action.
  *
  * @return void
  *
  * @Post("/uploadavatar", name="admin-user-uploadavatar")
  */
 public function uploadavatarAction()
 {
     $meta = $result = [];
     $myUser = new UserModel();
     $upload = $myUser->processUpload();
     if ($upload == $myUser->isSuccessUpload()) {
         $meta['status'] = true;
         $meta['message'] = 'Upload successfully.';
         $result = $myUser->getInfo();
     } else {
         $meta['success'] = false;
         $meta['message'] = $myUser->getMessage();
     }
     $this->view->setVars(['_meta' => $meta, '_result' => $result]);
 }