- 全局標簽
- artlist 文章列表
- models 欄目列表
- modelsartlist 頻道循環
- type 指定欄目
- include 引用模板
- arcview 單條文檔
- position 面包屑
- assign 定義變量
- empty 為空判斷
- notempty 不為空判斷
- foreach 循環輸出
- volist 數據循環
- if 條件判斷
- switch 條件判斷
- compare 變量比較
- adv 廣告列表
- load 文件加載
- global 全局變量
- field 字段值
- tags 標簽調用
- searchform 搜索標簽
- 常用函數
- links 友情鏈接
- SQL 數據查詢
- weapp 應用插件
- range 范圍判斷
- for 數據循環
- ad 單條廣告
- attribute 欄目屬性
- user 會員信息
- diyurl 內鏈調用
- php標簽
- hotkeywords 熱門搜索
- notice 站內信
- asklist 問答列表
- citysite 城市站點
- navigation 導航菜單
- static 文件引入
- 會員信息(memberlist)
- 會員注銷標簽使用方法
- 列表標簽
- 內容標簽
- 可視化標簽
- 多語言標簽
if 條件判斷
【基礎用法】
標簽:if
描述:條件判斷,比switch判斷標簽更靈活些,視個人習慣而用。
用法:
{eyou:if condition='($eyou.field.has_children > 0)'}
當前欄目列表有下級欄目
{eyou:else /}
當前欄目列表沒有下級欄目
{/eyou:if}
文件:
無
屬性:
condition='' 原生php語法條件判斷
涉及表字段:
無
【更多示例】
-------------------------------示例1--------------------------------
描述:多層次判斷
{eyou:if condition='($eyou.field.has_children == 1)'}
當前欄目列表的欄目ID有1個下級欄目
{eyou:elseif condition='($eyou.field.has_children == 2)' /}
當前欄目列表的欄目ID有2個下級欄目
{eyou:else /}
當前欄目列表的欄目ID有N個下級欄目
{/eyou:if}
-------------------------------示例2--------------------------------
描述:if標簽之間嵌套
{eyou:if condition='($eyou.field.has_children > 0)'}
{eyou:if condition='($eyou.field.has_children == 1)'}
當前欄目列表的欄目ID有1個下級欄目
{eyou:elseif condition='($eyou.field.has_children == 2)' /}
當前欄目列表的欄目ID有2個下級欄目
{eyou:else /}
當前欄目列表的欄目ID有N個下級欄目
{/eyou:if}
{/eyou:if}
文檔最后更新時間:2023-10-23 17:30:30
未解決你的問題?請到「問答社區」反饋你遇到的問題