Controller operationEmpty Operation
when the system cannot find the requested method, it locates to the __empty() method processing, using this mechanism, we can handle the non-existent operation of the user request uniformly.
NULL controller
when the system request cannot find the controller, it is located on the empty controller Emptycontroller.
cross-controller invocation
1. Direct instantiation
2,A ()
A () is used to instantiate other controllers.
$obj->display ("Manager/managertest1")// call is a template
3,R ()
R () and A () Basically, the only difference is that the R () function passes the action method along with the controller when it is instantiated, omitting the invocation of the method
configuration file for TP framework
Formula configuration: thinkphp/conf/convention.php
application Configuration: application/common/conf/config.php
Debug Configuration: application/common/conf/debug.php
Module Configuration: application/home/conf/config.php
Load order
Custom Configuration , application configuration , Debug Configuration , module configuration
Priority level:
module Configuration > Debug Configuration > application Configuration > Custom Configuration
C (' configured name ') used to obtain configuration information.
TP Framework Syntax
The judgment (the variable in the expression does not need {} plus {} will be the error variable and the variable comparison, the field is [] to indicate, not point)
<if Condition= ' expression ' >
<elseif condition= ' expression '/>
<else/>
</if>
an operator in an expression
PHP Operators |
The operator in the corresponding TP |
English full Name |
< |
Lt |
L ess than |
> |
Gt |
G Reater than |
== |
eq |
Equal |
>= |
Egt |
E qual or greater than |
<= |
Elt |
|
cycle (for,foreach,volist)
connecting to a database
In the configuration file, you can connect to the database by doing the configuration as above
Thiinkphp 3.2 Controller Operation profile Syntax (judging, looping) connection database