Smarty the logical operation symbol of the template to do a little summary

Source: Internet
Author: User

Make a summary of the logical operation symbols for Smarty templates for later use.

EQ Equal: Equal
NEQ not equal: Not equal to
GT greater than: greater than
Lt less than: smaller than
LTE lesser than or equal: less than or equal to
GTE great than or equal: greater than or equal to
is even: an even number
Is odd: it is odd
Is isn't even: not even
Is isn't odd not an odd number
Not: Non-
MoD: Finding the modulus and taking the remainder
Div by: ... Except
&& and: and
|| Or: OR
Is (not) div by can be divisible by a number, for example: {if $smarty. Get.age is div by 3} ... {/if}
is [not] even whether it is an even number, for example: $a is "not" even by $b i.e. ($a/$b)% 2 = = 0,
Is "not" odd is odd, for example: $a is not odd by $b i.e. ($a/$b)% 2! = 0

{if $_global_password} is determined that the variable is not present ....

{if $_global_password!== '} is a judgment variable etc. not equal to null ....

The IF statement and the IF in Smarty must appear in pairs of/if. You can use the else and elseif clauses.

The templates use EQ, NE, neq, GT, LT, LTE, Le, GTE, GE, is even, is odd, is not even, is not odd, not, MoD, div by, even by, odd by, = =,! =, >, <, <=, >= These logical operation symbols must be and variables or constants with the empty open.

Smarty the logical operation symbol of the template to do a little summary

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.