Thinkphp Special Label Usage overview _ php instance

Source: Internet
Author: User
This article mainly introduces the usage of thinkphp special labels, and analyzes the usage of tags such as in, between, present, and Empty, which has some reference value, for more information about the ThinkPHP special tag usage, see the example in this article. Share it with you for your reference. The specific analysis is as follows:

Special labels:

1. compare tags

Equal to eq or equal

Neq or notequal is not equal

Gt>

Egt greater than or equal

Lt is less

Elt less than or equal

Heq constant equals

Nheq is not always equal

2. range tag

In

The code is as follows:

In these numbers Not within the range of these numbers

In these numbers Not within the range of these numbers

Between

The code is as follows:

Between {$ n} and 1-10 {$ N} is not between 1 and 10.

3. present

Label to determine whether the template variable has been assigned a value

The code is as follows:

M has a value assignment. M is not assigned a value.

4. Empty

Empty tag determines whether the template variable is empty

The code is as follows:

N is null N value

5. Defined

Determine whether a constant has been defined

6. Define

Define constants in the template

7. Assing

Variable assignment in the template

Other labels:

1. directly use PHP code in the template

The code is as follows:

Echo "this is my home"

2. it is recommended to change the left and right delimiters.

Change in configuration file

The code is as follows:

'Tmpl _ L_DELIM '=>' <{', // modify the left delimiter

'Tmpl _ R_DELIM '=>'}> ', // modify the right delimiter

I hope this article will help you with ThinkPHP framework programming.

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.