Prepare:
Create a file named requests.php under index/controller (note: don't name it request, because it is a keyword and is not allowed to be named )
The difference between dynamic and static methods:
Static method: public static function test(){}
Dynamic method: ;public function test(){}
It can be seen that the difference between them is that one is a static method and the other is an ordinary method.
Dynamic method usage request
Access via url: localhost/tp5 framework directory/thinkpublic//index.php/index/requests/request?name='small hamster'&age=18
Use through static proxy
Output result:
Using requests via dependency injection
result:
Use the properties encapsulated in the Controller class
result:
above
END