Home Backend Development PHP Tutorial Summary of smarty logical operation symbols_PHP tutorial

Summary of smarty logical operation symbols_PHP tutorial

Jul 13, 2016 am 10:31 AM
smarty

I haven’t used Smarty for a project for a long time. Today I suddenly have to change some things in my website, because my website was made with the smarty template engine a long time ago. After changing some parts, I feel that it is not enough. I searched the Internet for answers. It seems that I am already unfamiliar with smarty, which I haven’t seen for a long time. I need to catch up on it quickly. Let’s briefly summarize the logical operation symbols of Smarty templates for future use.

eq equal : equal
neq not equal:not equal to
gt greater than: greater than
lt less than: less than
lte less than or equal:less than or equal
gte great than or equal:greater than or equal
is even: It is an even number
is odd: It is an odd number
is not even: not an even number
is not odd is not an odd number
not:   🎜> mod: Find the modulus and remainder
div by: quilt. . . except
&& and : And
|| or : or
is [not] div by Whether it can be divided by a certain 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, that is ($a / $b) % 2 == 0,
is [not] odd Whether it is odd, for example: $a is not odd by $b, that is ($a / $b) % 2 != 0

{if $_global_password} is to determine whether the variable exists....

{if $_global_password!==''} is to judge whether the variables are not equal to empty....

The if statement and if in Smarty must appear in pairs with /if. Else and elseif clauses can be used.

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 in the template , ==, !=, >, <, <=, >= these logical operation symbols must be separated from variables or constants by spaces.

Articles you may be interested in

    How to restrict js to only enter English letters and numbers, but not Chinese and other special characters
  • Smarty template retains variables Summary
  • Smarty variable operator summary
  • smarty include file Method of using variables
  • smarty video tutorial sharing
  • Mysql query string with single quotes and insertion Things to note about strings with single quotes
  • Using php functions in smarty templates and how to use multiple functions for one variable in smarty templates
  • php uses header() to implement file downloads, downloaded files Solution to the problem that the prompt is damaged and cannot be opened

http://www.bkjia.com/PHPjc/764127.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764127.htmlTechArticleI haven’t used Smarty for a project for a long time. Today I suddenly have to change some things in my website because my website It was made using the smarty template engine a long time ago. I changed some places...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use PHP and Smarty to achieve front-end and back-end separation development How to use PHP and Smarty to achieve front-end and back-end separation development Jun 25, 2023 pm 01:46 PM

How to use PHP and Smarty to achieve front-end and back-end separation development

A preliminary study on the template engine Smarty in PHP A preliminary study on the template engine Smarty in PHP May 11, 2023 pm 05:15 PM

A preliminary study on the template engine Smarty in PHP

How to use Smarty template engine in PHP development How to use Smarty template engine in PHP development Jun 27, 2023 pm 01:28 PM

How to use Smarty template engine in PHP development

How to use PHP and the Smarty template engine How to use PHP and the Smarty template engine May 11, 2023 pm 03:33 PM

How to use PHP and the Smarty template engine

what are thinkphp and smarty what are thinkphp and smarty Jun 14, 2022 pm 05:56 PM

what are thinkphp and smarty

How to use Smarty SSTi How to use Smarty SSTi May 15, 2023 am 11:37 AM

How to use Smarty SSTi

How to use Smarty with CakePHP? How to use Smarty with CakePHP? Jun 03, 2023 pm 03:10 PM

How to use Smarty with CakePHP?

Application of template engine Smarty in PHP development Application of template engine Smarty in PHP development Jun 14, 2023 pm 02:02 PM

Application of template engine Smarty in PHP development

See all articles