Public Function Index () {import (' ORG. Util.page '); $m = D ("Tx_record"); $count = $m->count (); The total number of records that the query meets the requirements $page = new Page ($count, 10); Instantiate the total number of incoming records in a paging class and the number of records displayed per page $page-setconfig (' header ', ' record '); $Page-Setconfig (' theme ', ' <li><a>%totalrow%%header%</a></li> <li>%uppage%</ li> <li>%downPage%</li> <li>%first%</li> <li>%prePage%</li> < li>%linkpage%</li> <li>%nextPage%</li> <li>%end%</li> ');//( Customize the format of thinkphp with pagination) $show = $Page->show (); The paging display output $result = $m->limit ($Page->firstrow. ‘,‘ . $Page->listrows)->order ("id desc")->relation (True)->select (); $this->assign ("result", $result); $ This->assign ("page", $show); Assignment paging output $this->display ();}
thinkphp Pagination Instance