Heim >php教程 >php手册 >php google 风格分页代码

php google 风格分页代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:22:37933Durchsuche

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 pageCount || $j = $this->pageCount;$i   {
       $re .= $i ==  $this->currentPage
        ? '
  • '.$i.'
  • '." "
        : '
  • '.$i.'
  • '." ";
      }
      if($this->currentPage+$halfPer pageCount){
       if($this->currentPage+$halfPer*2 pageCount){
        $re .= '
  • ...
  • ';
       }else{
        $re .= '
  • ...
  • ';
       }
       $re .= '
  • '.$this->pageCount.'
  • ';
      }
        
      $re .= ' 
       

  
';
  return $re;
 }
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php 批量增加数据Nächster Artikel:PHP如何判断上传文件的类型