Comparison tab for view views of Thinkphp5.0

Source: Internet
Author: User

Comparison tab for view views of Thinkphp5.0
{eq name= "a" value= "Ten"}<P>Equal</P>{else/}<P>Not equal</P>{/eq} {equal name= "a" value= "Ten"}<P>Equal</P>{else/}<P>Not equal</P>{/equal} {neq name= "a" value= "Ten"}<P>Not equal</P>{else/}<P>Equal</P>{/neq} {notequal name= "a" value= "Ten"}<P>Not equal</P>{else/}<P>Equal</P>{/notequal} {egt name= "a" value= "Ten"}<P>Greater than or equal</P>{else/}<P>Less than</P>{/egt}

!!! If you need to compare two variables in a template, value values need to use the $ symbol:

$b can use double quotation marks, or single quotes.

     {eq name= "a" value= "$b"}    <p> variable A and variable B are equal </p >     {else/}    <p> variable A and variable B are not equal </p >     {/eq}
Conditional Judgment Label:

Switch Label:

{switch name= ' user_level '} {case value= ' 1 '}<P>VIP Members</P>{/case} {case value= ' 2 '}<P>Diamond Members</P>{/case} {case value= ' 3|4 '}<P>Platinum Members</P>{/case} {case value= ' 5 '}<P>Gold Members</P>{/case} {default/}<P>General Membership</P>{/switch}
Range Label:
<!--use of type equals in -{range name= "user_age" value= "10,11,12,13" type= "in"}<P>User age is one of 10, 11, 12, 13</P>{else/}<P>User age is not one of 10, 11, 12, 13</P>{/range}<!--type equals the use of between -{range name= "user_age" value= "10,13" type= "between"}<P>User age from 10 to 13</P>{else/}<P>The user age is not between 10 and 13</P>{/range}
Between tags:
{between name= "User_age" value= "10,13"} < P > user age between 10 and 13 </p>{else/}<P > User age is not between 10 and 13 </p>{/between}
Defined tags:
<!---defined Name= "App_name"}<p> Defines constants App_name</p>{else/}<p> Constants Not defined app_name</p>{/defined}
If label:
<!---<  ) "}<p></  p>{else/}<p> variable A is less than or equal to 10 or greater than or equal to 20 </ P > {/if}

Comparison tab for view views of Thinkphp5.0

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.