tp obtain the parameters of the way

Gets the parameter type conversion

$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());
    }
     
}

  

Guess you like

Origin www.cnblogs.com/aln0825/p/12068214.html