ThinkPHP模板的present标签用于判断模板变量是否已经赋值。
ThinkPHP模板引擎的present标签用来判断模板变量是否已经赋值,其功能相当于PHP中的isset()函数行为,格式如下:
<present name="变量名">要输出的内容</present>
用法举例如下:
<present name="username">{$username} 你好!</present>
该例子等同于:
if(isset($username)){ echo "$username 你好!"; }
此外,判断没有赋值可采用notpresent标签,用法如下:
<notpresent name="username">username不存在活未登录</notpresent>
还可以把上述两个标签合并为:
<present name="username">{$username} 你好!<else/>username不存在活未登录</present>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

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.

WebStorm Mac version
Useful JavaScript development tools