Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use paging in thinkPHP

Shulou Source: shulou.com Published: 2022-06-03 19:40:43 11月12日 Update

Editor to share with you how to use paging in thinkPHP, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The details are as follows:

Take an example.

Action page:

Public function show () {import ("ORG.Util.Page"); / / Import the paging class $news=D ("News"); $count = $news- > where ('`content_ type` ='. $id)-> count (); / / the total number of query records $p = new Page ($count, 10); $list = $contact- > where ('`content_ type` ='. $id)-> order ('sort')-> limit ($p-> firstRow. ','. $p-> listRows)-> select (); $p-> setConfig ('header',' data'); / / the paging style can be customized $p-> setConfig ('prev', ")

Tags: Style page article output middle score information content template query not much variable most instance data more knowledge industry information information channel channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS OPPO Reno Shulou Tech Info Redmi