1. 標簽名稱:if
2. 功能說明:根據對某些變量的判斷,規定指定條件,以控制頁面內容的顯示
3. 適用范圍:所有內容模板
4. 基本語法:
**用法一**
~~~
<input id="key" class="box" type="text" name="keyword"
{if isset($keyword)}
value="{$keyword}"
{/if}
placeholder="看我想看" />
~~~
**用法二**
~~~
{if $x==1||empty($x)}
最新
{elseif $x==2}
熱點
{elseif $x==3}
圖文
{/if}
~~~
**用法三**
~~~
<!-- if empty($list) -->
<div class="noresult">暫時沒有可顯示數據</div>
<!-- /if -->
~~~