Thinkphp entry 3-framework template, variable (47), thinkphp47

Source: Internet
Author: User

Thinkphp entry 3-framework template, variable (47), thinkphp47
[In the Controller call TEMPLATE]

Display () call the template of the current operation name

Display ('name') calls the template file with the specified name

Controller call template:

[Pass variables to the template in the Controller]

Pass variable information to the template in smarty

$ Smarty-> assign (variable name, value );

In the tp framework, assign () is also used to pass variable information to the template.

Left and right marks of ThinkPHP template engine:

ThinkPHP/Lib/Behavior/ParseTemplateBehavior. class. php

Modify the TP template engine tag

1. Two ways to pass variable information to the template:

$ This-> assign (name, value );

$ This-> name = value;

2. Output common variable information in the template

3. Output array element information in the template

1 {$ holobby [Table below]}

2 {$ holobby. Table below}

Output the property information of the object in the template.

{$ Ucenter-> attribute name}

{$ Ucenter: property name}

[Traverse array information]

Two methods:

Foreach and volist can be nested for traversal, with the deepest layer being three layers.

Foreach (parameter 1 parameter 2 parameter 3)

[General for loop output]

Lt: less than <

Gt: great than is greater

Eq: equal equals

Elt: less than or equal to less

Egt: great equal greater than or equal

Heq: heng equal constant equals

Nheq: not heng equal is not always equal

[Condition judgment structure]

If judgment

Dual Branch:

[Range Judgment]

In

InLabel usage

[Constant equals]

 

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.