empty 标签
empty 标签用来判断模板变量是否为空值,相当于 PHP 中的 empty() 函数行为。empty 标签格式如下:
<empty name="变量名">要输出的内容</empty>
例子:
<empty name="username">username 为空值</empty>
该例子等同于:
<?php
if(empty($username)){
echo 'username 为空值';
}
?>notempty 标签
对应的还有个 notempt...
ThinkPHP 模板 empty 标签用于判断模板变量是否为空值。
empty 标签用来判断模板变量是否为空值,相当于 PHP 中的 empty() 函数行为。empty 标签格式如下:
<empty name="变量名">要输出的内容</empty>
例子:
<empty name="username">username 为空值</empty>
该例子等同于:
<?php
if(empty($username)){
echo 'username 为空值';
}
?>对应的还有个 notempt...