仿dedecms下拉分页样式修改的thinkphp分页类实例_PHP

WBOY
Release: 2016-05-31 19:28:28
Original
902 people have browsed it

ThinkPHP

本文实例讲述了仿dede下拉分页样式修改的thinkphp分页类。分享给大家供大家参考。具体实现方法如下:

修改thinkphp分页类:如下拉列表式分页(类似dedecms分页):

纯html代码:

代码如下:

修改Page类操作:

Page.class.php页面,相关部分原代码:

代码如下:

$linkPage="";
for($i=1;$irollPage;$i++){
$page=($nowCoolPage-1)*$this->rollPage+$i;
if($page!=$this->nowPage){
if($pagetotalPages){
$linkPage .= " ".$page." ";
}else{
break;
}
}else{
if($this->totalPages != 1){
$linkPage .= " ".$page."";
}
}
}

修改后:

代码如下:

$linkPage="  ";

页面效果如下图所示:

希望本文所述对大家的ThinkPHP程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!