Home > Article > PHP Framework > 5 ways to get the parameters in the api request address in thinkphp6
The following tutorial column of thinkphp framework will introduce to you 5 methods of obtaining parameters in the api request address in thinkphp6. I hope it will be helpful to friends in need!
#First methodtp6 The difference from tp5 is that tp6 inherits the controller Baseconroller, so we can directly use the request method in Baseconroller.public function show(){ dump($this->request->param("abc",2,'intval')); }Parameter analysis
name Parameter name
##The third and fourth method
The fifth way to use request in human face mode
Personally, I think the first method is new in tp6, so we might as well develop it in practice Use it during the process, because it may be more convenient to use it. For example, it is very simple to judge whether it is a get request or other requests
The above is the detailed content of 5 ways to get the parameters in the api request address in thinkphp6. For more information, please follow other related articles on the PHP Chinese website!