Home > Backend Development > PHP Tutorial > php google style paging code_PHP tutorial

php google style paging code_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-20 11:06:39
Original
1130 people have browsed it

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;
 }


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445013.htmlTechArticlephp google 风格分页代码 public function showCtrlPanel_g($halfPer = 5){ $re = 'div class=pageMore ul lispan'.$this-lineCount.'条/span/li lispan'.$this-currentPage.'/'.$this-p...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template