Thinkphp entry 3-framework template, variable (47), and thinkphp47. Thinkphp entry 3-framework template, variable (47), thinkphp47 [call template in controller] display () call Template display (name) of current operation name) call the template text Thinkphp with the specified name. 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]
Listen (47), thinkphp47 [call template in controller] display () call the template of the current operation name display (name) call the template text of the specified name...