效果图:
步骤1:在think\paginator\driver下新建类Bootstrap2(自己命名)
<?php
namespace think\paginator\driver;
use think\Paginator;
class Bootstrap2 extends Paginator
{
//首页
protected function home()
{
if ($this->currentPage() > 1) {
return "<a href='" . $this->url(1) . "' title='首页'>首页</a>";
} else {
return "<p>首页</p>";
}
}
//上一页
protected function prev()
{
if ($this->currentPage() > 1) {
return "<a href='" . $this->url($this->currentPage - 1) . "' title='上一页'>上一页</a>";
} else {
return "<p>上一页</p>";
}
}
//下一页
protected function next()
{
if ($this->hasMore) {
return "<a href='" . $this->url($this->currentPage + 1) . "' title='下一页'>下一页</a>";
} else {
return"<p>下一页</p>";
}
}
//尾页
protected function last()
{
if ($this->hasMore) {
return "<a href='" . $this->url($this->lastPage) . "' title='尾页'>尾页</a>";
} else {
return "<p>尾页</p>";
}
}
//统计信息
protected function info()
{
return "<p class='pageRemark'>共<b>" . $this->lastPage .
"</b>页<b> " . $this->total