ThinkPHP,五、EMPTY NOTEMPTY 标签的使用详解
<p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">EMPTY
NOTEMPTY </span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:
MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">标签<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">empty</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">标签用于判断某个变量是否为空,用法:<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{empty
name="name"}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">name</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">为空值<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{/empty}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">条件判断<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">如果判断没有赋值,可以使用:<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{notempty
name="name"}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">name</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">不为空<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{/notempty}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">可以把上面两个标签合并成为:<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{empty
name="name"}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">name</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">为空<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{else
/}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">name</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">不为空<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{/empty}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">name</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">属性可以直接使用系统变量,例如:<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{empty
name="Think.get.name"}<o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">$_GET['name']</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">为空值<span lang="EN-US"><o:p></o:p></span></span></p><p>
</p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">{/empty}<o:p></o:p></span></p>
页:
[1]