Home Backend Development PHP Tutorial thinkphp特殊标签用法概述_PHP

thinkphp特殊标签用法概述_PHP

May 31, 2016 pm 07:27 PM
thinkphp usage

本文实例讲述了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 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 run thinkphp project How to run thinkphp project Apr 09, 2024 pm 05:33 PM

How to run thinkphp project

There are several versions of thinkphp There are several versions of thinkphp Apr 09, 2024 pm 06:09 PM

There are several versions of thinkphp

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

How to run thinkphp

Analyze the usage and classification of JSP comments Analyze the usage and classification of JSP comments Feb 01, 2024 am 08:01 AM

Analyze the usage and classification of JSP comments

How to install thinkphp How to install thinkphp Apr 09, 2024 pm 05:42 PM

How to install thinkphp

How to correctly use the exit function in C language How to correctly use the exit function in C language Feb 18, 2024 pm 03:40 PM

How to correctly use the exit function in C language

Which one is better, laravel or thinkphp? Which one is better, laravel or thinkphp? Apr 09, 2024 pm 03:18 PM

Which one is better, laravel or thinkphp?

Usage of WPSdatedif function Usage of WPSdatedif function Feb 20, 2024 pm 10:27 PM

Usage of WPSdatedif function

See all articles