Example #1
0
 /**
  * 以下、site, admin 共通 controller
  * 
  */
 protected function common_FileTmp_get_upload()
 {
     $this->api_accept_formats = array('html', 'json');
     $this->api_not_check_csrf = true;
     $this->controller_common_api(function () {
         $options = Site_Upload::get_upload_handler_options($this->u->id, IS_ADMIN);
         $uploadhandler = new MyUploadHandler($options, false);
         $file = $uploadhandler->get(false);
         if ($this->format == 'html') {
             $this->response_body = View::forge('filetmp/_parts/upload_image', $file)->render();
         } else {
             $this->response_body = $file;
         }
         return $this->response_body;
     });
 }