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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM