$html.='10 条/页 ';
$html.='20 条/页 ';
$html.='30 条/页 ';
$html.='50 条/页 ';
$html.=’ ';
$html.=’ 到第页 ';
$html.='确定 ';
$html.=’
’;return $html;
}
/**
-
页码按钮
-
@return string
*/
protected function getLinks()
{
$block = [
‘first’ => null,
‘slider’ => null,
‘last’ => null
];
$side = 3;
$window = $side * 2;
if ($this->lastPage < $window + 6) {
$block[
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
‘first’] = $this->getUrlRange(1, $this->lastPage);
} elseif ($this->currentPage <= $window) {
$block[‘first’] = $this->getUrlRange(1, $window + 2);
$block[‘last’] = t h i s − > g e t U r l R a n g e ( this->getUrlRange( this−>getUrlRange(this->lastPage - 1, $this->lastPage);
} elseif ( t h i s − > c u r r e n t P a g e > ( this->currentPage > ( this−>currentPage>(this->lastPage - $window)) {
$block[‘first’] = $this->getUrlRange(1, 2);
$block[‘last’] = t h i s − > g e t U r l R a n g e ( this->getUrlRange( this−>getUrlRange(this->lastPage - ($window + 2), $this->lastPage);
} else {
$block[‘first’] = $this->getUrlRange(1, 2);
$block[‘slider’] = t h i s − > g e t U r l R a n g e ( this->getUrlRange( this−>getUrlRange(this->currentPage - $side, $this->currentPage + $side);
$block[‘last’] = t h i s − > g e t U r l R a n g e ( this->getUrlRange( this−>getUrlRange(this->lastPage - 1, $this->lastPage);
}
$html = ‘’;
if (is_array($block[‘first’])) {
$html .= t h i s − > g e t U r l L i n k s ( this->getUrlLinks( this−>getUrlLinks(block[‘first’]);
}
if (is_array($block[‘slider’])) {
$html .= $this->getDots();
$html .= t h i s − > g e t U r l L i n k s ( this->getUrlLinks( this−>getUrlLinks(block[‘slider’]);
}
if (is_array($block[‘last’])) {
$html .= $this->getDots();
$html .= t h i s − > g e t U r l L i n k s ( this->getUrlLinks( this−>getUrlLinks(block[‘last’]);
}
return $html;
}
/**
-
渲染分页html
-
@return mixed
*/
public function render()
{
if ($this->hasPages()) {
if ($this->simple) {
return sprintf(
‘%s
$this->css(),
$this->prev(),
$this->getLinks(),
$this->next()
);
} else {
return sprintf(
‘%s
$this->css(),
$this->home(),
$this->prev(),
$this->getLinks(),
$this->next(),
$this->last(),
$this->info(),
$this->js()
);
}
}
}
/**
-
生成一个可点击的按钮
-
@param string $url
-
@param int $page
-
@return string
*/
protected function getAvailablePageWrapper($url, $page)
{