Thinkphp Getting started three-frame template, variable (thinkphp47),
"Call template on Controller"
Display () a template that invokes the name of the current operation
Display (' name ') invokes the template file of the specified name
Controller call template Four ways:
"Passing variables to the template in the controller"
Passing variable information to a template inside Smarty
$smarty-Assign (variable name, value);
Within the TP frame the same applies to assign () passing variable information to the template
Thinkphp the left and right tags of the template engine:
thinkphp/lib/behavior/parsetemplatebehavior.class.php
Modify the TP template engine tag
1 pass variable information to the template in two ways:
$this-Assign (name, value);
$this, name = value;
2 output common variable information in template
3 output array element information inside the template
1 {$hobby [table below]}
2 {$hobby. The following table}
Output object's property information inside the template
{$ucenter Property name}
{$ucenter: Property name}
"Traversing Array Information"
Two methods:
foreach and volist can be nested traversal, the deepest level is 3 layers.
foreach (parameter 1, parameter 2, parameter 3)
"Normal for loop output"
Lt:less than less than <
Gt:great than greater than
Eq:equal equals
Elt:less equal less than or equal to
Egt:great equal greater than or equal to
Heq:heng equal constant equals
Nheq:not Heng equal not constant equals
"Conditional judgment Structure"
If judgment
Two-way branch:
"Scope judgment"
In between
inch Label Use
"Constant equals"
http://www.bkjia.com/PHPjc/1014833.html www.bkjia.com true http://www.bkjia.com/PHPjc/1014833.html techarticle thinkphp Getting started three-frame template, variable (thinkphp47), "Call Template in Controller" display () call the template display (first name) of the current operation name to invoke the template text of the specified name ...