tp5 获取post,get,参数,表单上传的内容

原文:https://www.jianshu.com/p/90917829460a

use think\Request;

class Name

{

    $request = Request::instance();

    $method = $request->method();//获取上传方式

    $request->param();//获取所有参数,最全

    $get = $request->get();获取get上传的内容

    $post = $request->post();获取post上传的内容

    $request->file('file')获取文件

}
View Code

use think\Controller;
class Name
{
    $method = $this->request->method();//获取上传方式

     $this->request->param();//获取所有参数,最全

    $get =  $this->request->get();获取get上传的内容

    $post =  $this->request->post();获取post上传的内容

    $this->request->file('file')获取文件

}
View Code

 

posted @ 2019-07-03 10:47  小跑跑泡  阅读(9042)  评论(0编辑  收藏  举报