thinkphp Special Label Usage Overview _php Instance

Source: Internet
Author: User

The examples in this article describe the use of thinkphp special tags. Share to everyone for your reference. The specific analysis is as follows:

Special Label:

1. Comparison label

eq or Equal equals

NEQ or notequal is not equal to

GT Greater than

EGT is greater than or equal to

LT is less than

ELT is less than or equal to

HEQ constant equals

Nheq not constant equals

2. Range Label

In

Copy Code code as follows:
<in name= ' n ' value= ' 9,10,11,12 ' > in these numbers <else/> not within the range of these numbers </in>

<notin name= ' n ' value= ' 9,10,11,12 ' > in these numbers <else/> not within the range of these numbers </in>

Between

Copy Code code as follows:
<notbetween name= ' n ' value= ' 1,10 ' >{$n} between 1-10 <else/>{$n} is not between 1 and 10 </between>

3.present

Label to determine if the template variable has been assigned

Copy Code code as follows:
<present name= ' m ' >m is assigned a value <else/>m not assigned </present>

4.Empty

Empty label to determine if the template variable is empty

Copy Code code as follows:
<empty name= ' n ' >n for null assignment <else/>n value </empty>

5.Defined

To determine whether a constant has been defined

6.Define

Defining constants in a template

7.Assing

Variable assignment in a template

Other labels used:

1. Use PHP code directly in the template

Copy Code code as follows:
<php> echo "This is the cloud habitat community" </php>

2. Suggest changing the left and right delimiters

Change in configuration file

Copy Code code as follows:
' Tmpl_l_delim ' => ' <{',//modify left delimiter

' Tmpl_r_delim ' => '}> ',//Modify right delimiter

I hope this article will be helpful to everyone's thinkphp framework program design.

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.