PHP分类页
天蓬老师
天蓬老师 2017-04-10 17:10:16
[PHP讨论组]
all = $all;
        $this->now = $now;
        $this->seletor = $seletor;
        $this->url = $url;
        if($this->now > $this->all ){
            $this->all = 0;
        }
        if($this->now < 1){
            $this->now = 1;
        }
    }
    public function display(){
        $str = "
    "; // if($this->all == 0){ // $str.="

    没有相关记录

    "; // }else{ if($this->all == 1){ $str.="
  • 1(current)
  • "; }else{ if($this->now > 1 && $this->now < 6){ $str.="
  • 第一页
  • «
  • "; for($i = 1; $i < $this->now; $i++) { $str.="
  • {$i}
  • "; } }elseif($this->now >= 6){ $str.="
  • 第一页
  • «
  • ...
  • "; for($i = $this->now-4; $i < $this->now; $i++) { $str.="
  • {$i}
  • "; } } $str.="
  • {$this->now}(current)
  • "; if($this->all - $this->now > 4) { for($i = $this->now + 1; $i <= $this->now + 4; $i++) { $str.="
  • {$i}
  • "; } $str.="
  • ...
  • »
  • 最后页
  • "; }elseif($this->all - $this->now >= 1){ for($i = $this->now + 1; $i <= $this->all; $i++) { $str.="
  • {$i}
  • "; } $str.="
  • »
  • 最后页
  • "; } } $str.=" 跳到GO
"; $str.= ""; // } return $str; } } ?>

我想问问这种分页什么意思 怎么有js代码

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(3)
PHP中文网

这个应该是分页类。传入分页数据(一页显示条数,页数,页码等)直接生成HTML代码和分页的数据

天蓬老师

与楼上的回答一致... 生成分页好的点击样式直接输出成html页面代码.. 包含样式/点击跳转等...

阿神

其实就是图简单,php 直接输出 html,然后页面上就有分页按钮了,但是修改样式的时候就比较不好控制

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号