Home >Backend Development >PHP Tutorial >Can the custom model in thinkphp get the value of the address bar get?

Can the custom model in thinkphp get the value of the address bar get?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-06 13:51:521381browse

The method of calling the custom model in the controller is just calling the method in the model
The model cannot be accessed at all. Why can I get the parameters of the address bar?

You can get it by using the I('get.xxx') method that comes with TP

Reply content:

The method of calling the custom model in the controller is just calling the method in the model
The model cannot be accessed at all. Why can I get the parameters of the address bar?

You can get it by using the I('get.xxx') method that comes with TP

$_GET is a global predefined constant that can be accessed anywhere in the PHP program. It should be noted that it is not recommended to obtain such parameters directly from the environment in the framework. You should use the methods defined by the framework to obtain them

One question is why the controller does not pass parameters to the model
Another point is that if you cannot get the value in the model, it only means that your file is wrong, or the statement is skipped by a conditional statement

TP3.2 can use I("get.name") to get the name value
5.0 can be obtained by specifying the method of the input class. I feel that you will basically not use the 5.0 version without further explanation

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn