.paginationp{margin:0;光标:指针}.pagination{高度:40px;填充:20px0px;}.paginationa{显示:块;向左飘浮;右边距:10px;填充:2px12px;高度:24px;边框:1px#cccccc实心;背景:#fff;文字装饰:无;颜色:#808080;字体大小:12px;行高:24px;}.paginationa:hover{颜色:#1e568f;背景:白色;边框:1px#1e568f实心;}.paginationa.cur{边界:无;背景:#1e568f;颜色:#fff;}.paginationp{浮动:左;填充:2px12px;字体大小:12pX;高度:24px;行高:24px;颜色:#bbb;边框:1px#ccc实心;背景:#fcfcfc;右边距:8px;}.paginationp.pageRemark{border-style:none;背景:无;右边距:0px;填充:4px0px;颜色:#666;}.paginationp.pageRemarkb{颜色:红色;}.paginationp.pageEllipsis{border-style:none;背景:无;填充:4px0px;颜色:#808080;}.datesli{font-size:14px;margin:20px0}.dateslispan{float:right}1.安装tp6.0multi-appcomposer需要topthink/think-multi-app2。安装viewcomposer需要topthink/think-view3。删除控制器文件4.修改config/app.php文件,如果没有变化,不需要改//Openmulti-app'auto_multi_app'=>true5.创建应用程序phpthinkbuildindex6。自定义分页类'think\Paginator'=>'app\common\Layuipaginate'7.分页类代码currentPage()>1){return"url(1)。"'title='首页'>首页";}else{return"首页
";}}//上一页保护函数prev(){if($this->currentPage()>1){return"url($this->currentPage-1)。"'title='上一页'>上一页";}else{return"上一页
";}}//下一页保护函数next(){if($this->hasMore){返回"url($this->currentPage+1)。"'title='下一页'>下一页";}else{return"Next
";}}//Lastpageprotectedfunctionlast(){if($this->hasMore){return"url($this->lastPage)。"'title='最后一页'>最后一页";}else{return"最后一页
";}}//统计保护函数info(){return"total".$this->lastPage。“页面”。$这个->总计。"数据
";}/***页面按钮*@returnstring*/protectedfunctiongetLinks(){$block=['first'=>null,'slider'=>null,'last'=>null];$边=3;$window=$side*2;如果($this->lastPage<$window+6){$block['first']=$this->getUrlRange(1,$this->lastPage);}elseif($this->currentPage<=$window){$block['first']=$this->getUrlRange(1,$window+2);$block['last']=$this->getUrlRange($this->lastPage-1,$this->lastPage);}elseif($this->currentPage>($this->lastPage-$window)){$block['first']=$this->getUrlRange(1,2);$block['last']=$this->getUrlRange($this->lastPage-($window+2),$this->lastPage);}else{$block['first']=$this->getUrlRange(1,2);$block['slider']=$this->getUrlRange($this->currentPage-$side,$this->currentPage+$side);$block['last']=$this->getUrlRange($this->lastPage-1,$this->lastPage);}$html='';如果(is_array($block['first'])){$html.=$this->getUrlLinks($block['first']);}如果(is_array($block['slider'])){$html.=$this->getDots();$html.=$this->getUrlLinks($block['slider']);}if(is_array($block['last'])){$html.=$this->getDots();$html.=$this->getUrlLinks($block['last']);}返回$html;}/***流染页面html*@returnmixed*/publicfunctionrender(){if($this->hasPages()){if($this->simple){returnsprintf('%s
%s%s%s ',$this->css(),$this->prev(),$this->getLinks(),$this->next());}else{returnsprintf('%s