Thinkphp分页样式改造Bootstrap版本

浏览:11055 发布日期:2014/01/02 分类:功能实现 关键字: Bootstrap分页,Thinkphp分页改造
Thinkphp分页样式改造成Bootstrap版本,还是非常简单的。
1.修改类库,目录:ThinkPHP/Extend/Library/ORG/Util/Page.class.php
把所有分页的样式加上<li></li>标签

2.程序调用类库,关键是$Page->setConfig    import('ORG.Util.Page');// 导入分页类
$count      = $this->dao->where($map)->count();//总数量
$Page       = new Page($count,5);
// 实例化分页类 传入总记录数和每页显示的条数
$Page->setConfig('theme', '<li><a>%totalRow% %header%</a></li> %upPage% %downPage% %first%  %prePage%  %linkPage%  %nextPage% %end% ');
$show       = $Page->show();// 分页显示输出
$this->assign('page',$show);// 赋值分页输出            
4.模板内容<div class="pagination">
    <ul>
       <?php echo $page;?>
    </ul>
</div>


更多Bootstrap模板,访问http://www.js-css.cn JS代码网


附件 Page.class.zip ( 2.08 KB 下载:688 次 )

评论( 相关
后面还有条评论,点击查看>>