<? (); ; ; ; ; ; ; ; ; ; = ; = '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 = ['startPage'] = ->->endPage = ->startPage + -1->startPage = ['startPage'] = ->page - + 1->endPage = ->startPage + -1{ (->page == ->->startPage = ['startPage'] = ->page - + 1->endPage = ->startPage + -1 ->startPage = (->pageMax - + 1, ->startPage); ->startPage = (->startPage, 1); ->endPage = ->startPage + -1->endPage = (->pageMax, ->endPage); ['startPage'] = ->startPage; (->page <= 1){ = '<span>'.->config['first'].'</span>' = '<span>'.->config['prev'].'</span>' = "<span><a href='&->varPage=1'>".->config['first'].'</a>' = "<span><a href='&->varPage=->prevPage'>".->config['prev'].'</a>'(->page >= ->pageMax){ = '<span>'.->config['next'].'</span>' = '<span>'.->config['last'].'</span>' = "<a href='&->varPage=->pageMax'>".->config['last'].'</a>' = "<a href='&->varPage=->nextPage'>".->config['next'].'</a>'(){ (->nextPage >= ->pageMax)? = '' : ->prevPage < 1)? = '' : ( = ->startPage; <= ->endPage; ++ (->page == .= "<a class='current' href='&->varPage='></a>" .= "<a href='&->varPage='></a>" = ('%records%','%header%','%page%','%pageMax%','%firstPage%','%prevPage%','%linkPage%','%nextPage%','%lastPage%' = (->records,->config['header'],->page,->pageMax,,,,, = (, , ->config['theme' = Page(340, 10 = '%records% %header% %page%/%pageMax% 頁 %firstPage%%prevPage%%linkPage%%nextPage%%lastPage%'->setConfig('theme',); ->setConfig('last','末頁'); ->url = 'http://localhost/test.php' ->show(10?> <style>,span{ margin:.{ color:</style>