tp获取参数的方式

获取参数类型转换

$this->reuqest->param('abc',1,'intval')

  

<?php

namespace app\controller;

use app\BaseController;

use think\Request;
use think\facade\Request as R;

class Learn extends BaseController
{
    public function index(Request $request)
    {
        dump($request->param());
       
    }
    public function index1()
    {
        dump(R::param());
    }
    public function index2()
    {
        dump(input());
    }
    public function index3()
    {
        dump(request()->param());
    }
    public function index4()
    {
        dump($this->request->param());
    }
     
}

  

posted @ 2019-12-19 15:46  X__cicada  阅读(273)  评论(0编辑  收藏  举报