- 全局標簽
- 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)
- 會員注銷標簽使用方法
- 列表標簽
- 內容標簽
- 可視化標簽
- 多語言標簽
range 范圍判斷
【基礎用法】
標簽:range
描述:范圍判斷標簽包括in notin between notbetween四個標簽,都用于判斷變量是否中某個范圍。
用法:
{eyou:range name='$eyou.field.typeid' value='1,2,3,4' type='in'}
輸出內容
{/eyou:range}
屬性:
name='' 變量
value='' 范圍值
type='' 標簽類型
type='in' 在指定列表值內
type='notin' 不在指定列表值內
type='between' 在指定區間范圍內
type='notbetween' 不在指定區間范圍內
涉及表字段:
無
【更多示例】
-------------------------------示例1--------------------------------
描述:當前欄目ID在指定列表值1,2,3內,則顯示“EyouCms”字樣
{eyou:range name='$eyou.field.typeid' value='1,2,3' type='in'}
EyouCms
{/eyou:range}
-------------------------------示例2--------------------------------
描述:當前頁面是列表頁、內容頁,則顯示“EyouCms”字樣
{eyou:range name='$Think.const.ACTION_NAME' value='lists,view' type='in'}
EyouCms
{/eyou:range}
-------------------------------示例3--------------------------------
描述:當前頁面不是首頁、產品模型,則顯示“EyouCms”字樣
{eyou:range name='$Think.const.CONTROLLER_NAME' value='Index,Product' type='notin'}
EyouCms
{/eyou:range}
-------------------------------示例4--------------------------------
描述:當前內容頁aid在指定區間范圍1~10內,則顯示“EyouCms”字樣
{eyou:range name='$eyou.field.aid' value='1,10' type='between'}
EyouCms-在1~10區間范圍內
{/eyou:range}
-------------------------------示例5--------------------------------
描述:當前內容頁aid不在指定區間范圍1~10內,則顯示“EyouCms”字樣
{eyou:range name='$eyou.field.aid' value='1,10' type='notbetween'}
EyouCms-在1~10區間范圍內
{/eyou:range}
-------------------------------示例6--------------------------------
描述:可以使用else標簽把between、notbetween兩個用法合并
{eyou:range name='$eyou.field.aid' value='1,10' type='between'}
在1~10區間范圍內
{eyou:else /}
不在1~10區間范圍內
{/eyou:range}
文檔最后更新時間:2023-10-23 17:19:28
← weapp 應用插件
for 數據循環 →
未解決你的問題?請到「問答社區」反饋你遇到的問題