##一、分页配置
$Page = new \Think\Page($count, 10);
$Page->setConfig('header','<span class="total">共<b>%TOTAL_ROW%</b>条数据,第<b>%NOW_PAGE%</b>页/共<b>%TOTAL_PAGE%</b>页</span>');
$Page->setConfig('prev','上一页');
$Page->setConfig('next','下一页');
$Page->setConfig('last','末页');
$Page->setConfig('first','首页');
$Page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
##二、分页样式
对Page.class.php进行了稍微的修改,不影响正常使用,替换即可。
page.css 定义了很多分类样式。
样式引入:
<link rel="stylesheet" href="__CSS__/page.css"/>
模板调用:
<div class="viciao"><{$page}><div/>
效果:
附:本人自配样式
.paging { clear: both; }
.paging a {
display: inline-block;
padding: 0 10px;
min-width: 28px;
height: 28px;
margin-left: 5px;
border: 1px solid #ccc;
background: #fff;
color: #666;
text-align: center;
line-height: 28px;
}
.paging .num:hover,
.paging .prev:hover,
.paging .next:hover {
text-decoration: none;
border: 1px solid #0080f0;
color: #0080f0;
}
.paging .total {
display: inline-block;
height: 30px;
padding: 0 10px;
line-height: 30px;
}
.paging .current {
display: inline-block;
width: 30px;
height: 30px;
margin-left: 5px;
text-align: center;
line-height: 30px;
}
.paging .prev,
.paging .current {
margin-left: 0;
}
.paging .rows {
margin-left: 5px;
color: #666;
}
使用:
<div class="paging text-right">
{$page}
</div>
效果:
欢迎关注技术开发分享录:http://fenxianglu.cn/