更改后的样式
1.先配置你的分页参数:
文件 app/config.php
//分页配置
'paginate' => [
'type' => 'bootstrap',
'var_page' => 'page',
'list_rows' => 15,
],
2.修改thinkphp/library/think/paginator/driver/Bootstrap.php 文件 如下
<?php
/**
* 上一页按钮
* @param string $text
* @return string
*/
protected function getPreviousButton($text = "上一页")
{
if ($this->currentPage() <= 1) {
return $this->getDisabledTextWrapper($text);
}
$url = $this->url(
$this->currentPage() - 1
);
return $this->getPageLinkWrapper($url, $text);
}
//总数标签
protected function totalshow()
{
$totalhtml="<li class=\"disabled\"><span>共".$this->total."条 ".$this->currentPage()."/".$this->lastPage()."</span></li>";
return $totalhtml;
}
//尾页标签
protected function showlastpage($text = '尾页')
{
if($this->currentPage()==$this->lastPage())
{
return $this->getDisabledTextWrapper($text);
}
$url = $this->url($this->lastPage());
return $this->getPageLinkWrapper($url, $text);
}
//首页标签
protected function showfirstpage($text = '首页')
{
if($this->currentPage()==1)
{
return $this->getDisabledTextWrapper($text);
}
$url = $this->url(1);
return $this->getPageLinkWrapper($url, $text);
}
//后五页
protected function afivepage($text = '后五页')
{
if($this->la