How to use paging in thinkPHP
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', ")