更新:自定义分页支持自定义输出分页按钮个数
parent
63f1189779
commit
722992e615
|
@ -85,9 +85,12 @@ class CustomPageHelper extends Paginator
|
|||
return $this->getPageLinkWrapper($url, $text);
|
||||
}
|
||||
|
||||
// 渲染分页
|
||||
public function render($type = '')
|
||||
// 渲染分页 $btnNumber [0 只显示上下页 | >= 3]
|
||||
public function render($btnNumber = 10, $type = '')
|
||||
{
|
||||
if($btnNumber == 0 || $btnNumber >= 3) {
|
||||
$this->btnNumber = $btnNumber;
|
||||
}
|
||||
//数据是否足够分页
|
||||
if ($this->hasPages()) {
|
||||
if(strtoupper($type) == 'A') {
|
||||
|
@ -154,7 +157,7 @@ class CustomPageHelper extends Paginator
|
|||
foreach ($urls as $page => $url) {
|
||||
$html .= $this->getPageLinkWrapper($url, $page, $htmlClass);
|
||||
}
|
||||
if($ellipsis) {
|
||||
if($ellipsis && $this->btnNumber > 0) {
|
||||
$html .= $this->getDisabledTextWrapper('...', $htmlClass);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue