pbootcms常用標籤程式碼集合

黄文Rex發表於2024-09-27

內容整理成表格的形式,便於查閱和使用:

功能 標籤 引數 示例 說明
模板檔案巢狀引用 {include file=***.html} {include file=head.html} 可以巢狀使用,如:index.html 巢狀 head.html,同時 head.html 中巢狀 comm.html。支援使用子目錄。
時間格式化標籤 [list:date]<br>{content:date} style=* [list:date style=Y-m-d]<br>{content:date style=Y-m-d} 時間格式化標籤和 PHP 時間格式化語法一致。參考連結:PHP 時間格式化
HTML 去除標籤 [list:content]<br>{content:content} drophtml=1 [list:content drophtml=1]<br>{content:content drophtml=1} 一般在首頁等特殊位置需要調取正文一段純文字時使用。
內容擷取標籤 [list:title]<br>{content:title} len=*<br>lencn=*<br>more=* [list:title len=10]<br>{content:title len=10}<br>[list:title more=*] 長度擷取使用 len=lencn=,使用 more=* 設定省略號內容。
其它格式化標籤 [list:content]<br>{content:content} dropblank=1<br>decode=1<br>decimal=*<br>unit=*<br>operate=*<br>lfield=*<br>mark=1 [list:content dropblank=1]<br>[list:content decode=1]<br>[list:content decimal=2]<br>[list:content unit=kb]<br>[list:content operate=+1000]<br>[list:content lfield=a,b]<br>[search:title mark=1] 去除空白字元、解碼資料、小數點位數、容量單位、數字運算、限制列表資料查詢欄位、標紅搜尋結果關鍵字。
自定義標籤 {label:*} {label:custom_label} 在後臺“全域性配置 > 定製標籤”中定義,前臺使用對應名字進行呼叫。
麵包屑標籤 {pboot:position} separator=*<br>separatoricon=*<br>indextext=*<br>indexicon=* {pboot:position separator=>> separatoricon=’fa fa-angle-double-right’ indextext=首頁 indexicon=’fa fa-home’} 分隔符、分割圖示、首頁文字、首頁圖示。
當前網址 {pboot:httpurl} {pboot:httpurl} 自適應獲取當前訪問網址。
當前頁面 {pboot:pageurl} {pboot:pageurl} 自適應獲取當前訪問頁面完整地址。
二維碼生成標籤 {pboot:qrcode string=*} string=* {pboot:qrcode string={pboot:httpurl}{content:link}}<br>{pboot:qrcode string={pboot:pageurl}} 生成對應文字的二維碼圖片。
程式執行時間 {pboot:runtime} {pboot:runtime} 輸出頁面執行時間/快取時間。
留言驗證碼 {pboot:checkcodestatus} {pboot:checkcodestatus} 判斷留言驗證碼是否開啟狀態。
站點地圖 http://domain/index.php/sitemap<br>http://domain/index.php/sitemap.xml 訪問地址即為實時地圖。
圖片縮放及裁剪 [list:ico] width=*<br>height=*<br>maxwidth=*<br>maxheight=* [list:ico width=100]<br>[list:ico height=100]<br>[list:ico maxwidth=100]<br>[list:ico maxheight=100] 四個引數可以組合使用,生成改變了圖片大小的快取圖片。

透過以上表格,你可以快速查閱和使用PBootCMS的各種標籤和功能。

相關文章