结合 thinkPHP 分页写成自己分页类
程序员文章站
2022-04-02 21:10:38
...
// +----------------------------------------------------------------------
// $Id: page.class.php 2013-05-26 00:08:49
();
;
;
;
;
;
;
;
;
;
= ;
= 'header'=>'条记录','prev'=>'上一页','next'=>'下一页','first'=>'首页','last'=>'尾页',
'theme' => '%records% %header% %page%/%pageMax% 页 %firstPage%%prevPage%%linkPage%%nextPage%%lastPage%'
__construct(, , = 'p', = ->records = ->pageMax = (/->page= (([]), 1);
->page = (->page, ->pageMax);
->nextPage = ->page + 1->prevPage = ->page - 1->varPage = ;
->parameter = ;
setConfig(, ((->config[->config[] =
show(, = (0 == ->records) ''(->url)? ->url = ['REQUEST_URI'] : = ->url.((->url,'?')?'':'?').-> = (((['query'(['query'],([-> = ['path'].'?'.(('mid' == ->style){
( % 2 != 0 = ( / 2 = - 1 ;
} = = / 2 = - 1;
->startPage = (->page + ) > ->pageMax ? ->pageMax - : ->page - ->endPage = (->page )? : ->page + {
->startPage = (->page >= )? ['startPage'] : 1->endPage = ->startPage + - 1->lastPage = (['lastPage'])? ['lastPage'] : 1;
['lastPage'] = ->page;
(->lastPage ->page){
(->page >= ->->startPage = ['startPage'] = ->->endPage = ->startPage + -1(->lastPage == ->page){
(->page == ->->startPage =