一、作用
循環(huán)顯示出模塊所有可用模塊信息
二、語(yǔ)法
{list action=cache name=module ....}{/list}
簡(jiǎn)寫(xiě)(3.2.19以上版本支持):{cache name=module ....}{/cache }
三、參數(shù)介紹(紅色表示必填參數(shù),藍(lán)色表示系統(tǒng)默認(rèn)參數(shù))
參數(shù) | 介紹 |
---|---|
action | cache |
name | module |
site | 站點(diǎn)id,默認(rèn)當(dāng)前站點(diǎn),填寫(xiě)其他站點(diǎn)id表示查詢其他站點(diǎn)的模塊數(shù)據(jù) |
return | 默認(rèn)返回變量為t,調(diào)用方式就是{$t.字段值}(多級(jí)list查詢必須設(shè)置return=其他字母,否則你懂得) |
四、返回變量
變量 | 參數(shù) |
---|---|
{$error} | 當(dāng)查詢不到數(shù)據(jù)時(shí),會(huì)返回錯(cuò)誤信息,調(diào)試模板時(shí)很有用哦(寫(xiě)在list標(biāo)簽以外) |
{$count} | 當(dāng)前查詢的記錄,當(dāng)存在分頁(yè)時(shí),表示當(dāng)前頁(yè)的記錄數(shù)(寫(xiě)在list標(biāo)簽以外) |
{$key} | 當(dāng)前記錄指針位置,從0開(kāi)始(寫(xiě)在list標(biāo)簽以內(nèi)) |
當(dāng)存在return=字母時(shí),以上變量都要寫(xiě)成這種格式{$變量_字母},例如{list ...reutrn=a}時(shí),變量格式{$key_a} | |
{$is_first} | 判斷是否第一條,{if $is_first}第一條{/if} |
{$is_last} | 判斷是否最后一條,{if $is_last}最后一條{/if} |
五、相關(guān)例子
1、顯示當(dāng)前站點(diǎn)可用模塊數(shù)據(jù)
{list action=cache name=module} 模塊地址:{$t.url} 模塊名稱(chēng):{$t.name} 模塊目錄:{$t.dirname} {/list} {$error} // 錯(cuò)誤信息
2、顯示指定站點(diǎn)1的可用模塊數(shù)據(jù)
{list action=cache name=module site=1} 模塊地址:{$t.url} 模塊名稱(chēng):{$t.name} 模塊目錄:{$t.dirname} {/list} {$error} // 錯(cuò)誤信息
文檔最后更新時(shí)間:2018-09-29 08:28:43