原文:https://www.jianshu.com/p/90917829460a
use thinkRequest; class Name { $request = Request::instance(); $method = $request->method();//获取上传方式 $request->param();//获取所有参数,最全 $get = $request->get();获取get上传的内容 $post = $request->post();获取post上传的内容 $request->file('file')获取文件 }
或
use thinkController; class Name { $method = $this->request->method();//获取上传方式 $this->request->param();//获取所有参数,最全 $get = $this->request->get();获取get上传的内容 $post = $this->request->post();获取post上传的内容 $this->request->file('file')获取文件 }