作者:手机用户2502929965 | 来源:互联网 | 2022-12-22 06:41
php google风格分页代码publicfunctionshowCtrlPanel_g($halfPer5) { &
php google 风格分页代码
public function showCtrlPanel_g($halfPer = 5) {
$re =
- .$this->lineCount.条
- .$this->currentPage./.$this->pageCount.页
;
if($this->currentPage-$halfPer >1){
$re .= - 1
;
if($this->currentPage-$halfPer*2 >1){
$re .= - ...
;
}else{
$re .= - ...
;
}
}
for ( $i = $this->currentPage - $halfPer,$i > 1 || $i = 1 , $j = $this->currentPage + $halfPer, $j <$this->pageCount || $j = $this->pageCount;$i <= $j ;$i++ )
{
$re .= $i == $this->currentPage
? - .$i.
." "
: - .$i.
." ";
}
if($this->currentPage+$halfPer <$this->pageCount){
if($this->currentPage+$halfPer*2 <$this->pageCount){
$re .= - ...
;
}else{
$re .= - ...
;
}
$re .= - .$this->pageCount.
;
}
$re .=
;
return $re;
}