Current location - Recipe Complete Network - Complete cookbook of home-style dishes - $ this- > in the tp5 framework; Request-> get('id ', 100); What is the function?
$ this- > in the tp5 framework; Request-> get('id ', 100); What is the function?
$ this-& gt; Request-> Get('id', 100) means to get the value of id. If the id parameter is not submitted, it will be replaced by the default value, which means 100 can be obtained. When there is an id parameter, whether there is a value or not, the request shall prevail.

$ this-& gt; Request-> has('id ',' get ')? Yes, judge whether there is an id parameter. If there is an id parameter in the current get request, it will return true regardless of the value, and false if there is no id parameter.

When you don't understand, I suggest reading more source code of the framework, which is more helpful to you and more efficient than asking questions online.