<?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'); //助手函數
}
}