Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of thinkphp's own paging Class

Shulou Source: shulou.com Published: 2022-06-03 17:44:14 11月13日 Update

This article shares with you the content of the sample analysis of thinkphp's own paging classes. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Thinkphp comes with paging use cases:

$Data = M ('Data'); / / instantiate the Data data object date is your table name import (' ORG.Util.Page'); / / import the paging class $count = $Data- > where ($map)-> count (); / / the total number of records that meet the query requirements $map indicates the query condition $Page = new Page ($count); / / the total number of instantiated paging class incoming records $show = $Page- > show () / / paging display output / / paging data query $list = $Data- > where ($map)-> order ('id')-> limit ($Page- > firstRow.','.$Page- > listRows)-> select (); / / $Page- > firstRow starting number $Page- > listRows how many $this- > assign (' list',$list); / / assigned dataset $this- > assign ('page',$show); / / assigned paging output $this- > display () / / output template [{$vo.create_time | date='Y-m-d Hlav iRank] {$vo.title} {$page}

Paging effect:

Thank you for reading! This is the end of this article on "sample Analysis of thinkphp's own paging classes". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Data query output example analysis content example more article good practical object effect data query article condition case template see knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Apple Microsoft MariaDB