Thinkphp Getting started three-frame template, variable (thinkphp47_php), tutorial

Source: Internet
Author: User

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 ...

  • 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.