search
Homephp教程php手册thinkphp特殊标签用法概述

这篇文章主要介绍了thinkphp特殊标签用法,实例分析了in、between、present、Empty等标签的用法,具有一定的参考借鉴价值,需要的朋友可以参考下

本文实例讲述了ThinkPHP特殊标签用法。分享给大家供大家参考。具体分析如下:

特殊标签:

1、比较标签

eq或者 equal 等于

neq 或者notequal 不等于

gt 大于

egt 大于等于

lt 小于

elt 小于等于

heq 恒等于

nheq 不恒等于

2.范围标签

in

复制代码 代码如下:

在这些数字里面不在这些数字的范围内

在这些数字里面不在这些数字的范围内

between

复制代码 代码如下:

{$n}在1-10之间{$n}不在1到10之间

3.present

标签来判断模板变量是否已经赋值

复制代码 代码如下:

m有赋值m没有赋值

4.Empty

empty标签判断模板变量是否为空

复制代码 代码如下:

n为空赋值n有值

5.Defined

判断常量是否已经定义

6.Define

在模板中定义常量

7.Assing

模板中变量赋值

其他标签使用:

1、在模板中直接使用PHP代码

复制代码 代码如下:

echo "这里是脚本之家"

2、建议更改左右定界符

在配置文件中改变

复制代码 代码如下:

'TMPL_L_DELIM'=>'

'TMPL_R_DELIM'=>'}>', //修改右定界符

希望本文所述对大家的ThinkPHP框架程序设计有所帮助。

Statement
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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft