tp5 接收参数


<?php

namespace app\admin\controller;

use think\Controller;
use think\facade\Request;

class Demo extends Controller
{
    public function login($code = '', $nickname = '', $thumb = '', $gender = '')
    {
        //第一种判断
        if (!request()->isPost()) {
            return;
        }
        //第二种判断
        if (!$this->request->isPost()) {
            return;
        }

        $data = $this->request->post();//第二种接受参数
        $data = input('post.');//第三种接受参数

        //还有两种。。。
        $code = Request::param('code');   //Facade机制调用
        $code = request()->param('code');   //助手函数
    }
}


免责声明!

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



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