TP5 自定義分頁URL(攜帶自定義引數)

2021-09-05 07:41:31 字數 648 閱讀 9510

在做新聞或者商品的時候,url往往帶著引數跳轉,例如:www.***.com/redcm/news/newslist.html?classid=13

tp5自帶的分頁函式,預設url是這樣的:www.***.com/redcm/news/newslist.html?page=1

所以tp5自帶的分頁大多數情況下是滿足不了人們的正常使用的,這時候就需要我們去自定義分頁的url了,**如下:

上邊的僅供**,這裡的供給大家複製貼上~ ~

$where['query']['classid'] = $classid;

$newslist = db::name('infolist')->where(['status' => 1,'classid' => $classid])->paginate(1,'',$where);

加入這行**之後,分頁的url就變為:www.***.com/redcm/news/newslist.html?classid=13&page=2

所以明白query後的classid是什麼了吧~ ~

tp5自定義命令

建立自定義命令列 1.首先是註冊cammand return 2.建立類,繼承cammand usethink console command class chat extends command protected function execute input input,output outpu...

Tp5自定義標籤

taglib build in cx,tags 內建標籤庫名稱 標籤使用不必指定標籤庫名稱 以逗號分隔 注意解析順序 namespace think template taglib use think template taglib class tags extends taglib access ...

tp5自定義異常處理

1.傳統模式自定義異常處理 定義model層分母為0的異常資訊 url api model index.php use think exception class index catch exception ex return true 定義controller層index資訊 use think ...