做逻辑判断的。目前支持的有
divisibleby null even odd sameas constant defined empty
divisibleby
检查是否能被整除
{% if loop.index is divisibleby(3) %}
...
{% endif %}
{% if loop.index is divisibleby(3) %}
...
{% endif %}
null
{{ var is null }}
{{ var is null }}
even
变量是否是偶数{{ var is even }}
{{ var is even }}
odd
变量是否是奇数
{{ var is odd }} <br> <pre name="code" class="html">{{ var is odd }} <p> </p> <p> </p> <p>sameas<br> 检查变量的地址是否相同</p> <p>{% if foo.attribute is sameas(false) %} <br> the foo attribute really is the ``false`` PHP value <br> {% endif %} <br> {% if foo.attribute is sameas(false) %}<br> the foo attribute really is the ``false`` PHP value<br> {% endif %}</p> <p> </p> <p>constant<br> 检查变量的值是否相同</p> <p>{% if post.status is constant('Post::PUBLISHED') %} <br> the status attribute is exactly the same as Post::PUBLISHED <br> {% endif %} <br> {% if post.status is constant('Post::PUBLISHED') %}<br> the status attribute is exactly the same as Post::PUBLISHED<br> {% endif %}</p> <p> </p> <p>defined<br> 测试变量是否定义</p> <p>{# defined works with variable names #} <br> {% if foo is defined %} <br> ... <br> {% endif %} <br> <br> {# and attributes on variables names #} <br> {% if foo.bar is defined %} <br> ... <br> {% endif %} <br> <br> {% if foo['bar'] is defined %} <br> ... <br> {% endif %} <br> {# defined works with variable names #}<br> {% if foo is defined %}<br> ...<br> {% endif %}</p> <p>{# and attributes on variables names #}<br> {% if foo.bar is defined %}<br> ...<br> {% endif %}</p> <p>{% if foo['bar'] is defined %}<br> ...<br> {% endif %}</p> <p> </p> <p>empty<br> 测试变量是否为空,empty的意思是:该变量已经定义,但他的值是 null false 或者是空字符串<br> {# evaluates to true if the foo variable is null, false, or the empty string #} <br> {% if foo is empty %} <br> ... <br> {% endif %} <br> <br> 摘自 jiaochangyun的专栏</p>

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

MinGW - Windows용 미니멀리스트 GNU
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.

SublimeText3 Linux 새 버전
SublimeText3 Linux 최신 버전

DVWA
DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

안전한 시험 브라우저
안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.
