Thiinkphp 3.2 Controller Operation profile Syntax (judging, looping) connection database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.