该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

$str=$str.$this->commonTag($i);

}

$str=$str.$this->currentTag();

$str=$str.$this->next();

}else {

if ($this->currentPage<6) {

$str=$this->up();

for ($i = 1; $i < $this->currentPage; $i++) {

$str=$str.$this->commonTag($i);

}

$str=$str.$this->currentTag();

for ($i = $this->currentPage+1; $i <= 7; $i++) {

$str=$str.$this->commonTag($i);

}

$str=$str.'...';//添加省略号

$str=$str.$this->commonTag($this->totalPage);

$str=$str.$this->next();

}else {

if ($this->currentPage>=$this->totalPage-4) {

$str=$this->up();

$str=$str.$this->commonTag(1);

$str=$str.'...';//添加省略号

for ($i = $this->totalPage-6; $i < $this->currentPage; $i++) {

$str=$str.$this->commonTag($i);

}

$str=$str.$this->currentTag();

for ($i = $this->currentPage+1; $i <= $this->totalPage; $i++) {

$str=$str.$this->commonTag($i);

}

$str=$str.$this->next();

}elseif ($this->currentPagetotalPage-4){//1+5+1

$str=$this->up();

$str=$str.$this->commonTag(1);

$str=$str.'...';//添加省略号

$str=$str.$this->commonTag($this->currentPage-2);

$str=$str.$this->commonTag($this->currentPage-1);

$str=$str.$this->currentTag();

$str=$str.$this->commonTag($this->currentPage+1);

$str=$str.$this->commonTag($this->currentPage+2);

$str=$str.'...';//添加省略号

$str=$str.$this->commonTag($this->totalPage);

$str=$str.$this->next();

}

};

}

}elseif ($this->totalPage<=0){

throw new Exception("页面不可能小于1");

}

return $str;

}

/**

* 一般标签

* @param int $param 页码

* @return string

*/

function commonTag($param) {

return ''.$param.'';

}

/**

* 生成当前页标签

* @param int $param 页码

* @return string

*/

function currentTag() {

return ''.$this->currentPage.'';

}

/**

* 生成下一页标签

* @param int $param 下一页页码

php地址后面拼接页码,php分页类尾部页码导航代码相关推荐

  1. javascript分页类支持页码格式

    前端时间因为项目需要,要对一个产品下所有的附属图片进行分页显示,没考虑ajax一张张请求,所以干脆一次性全部把图片out,然后在载入的时候进行分页,网上很多jquery,property等都实现了,但 ...

  2. Sqlserver存储过程和C#分页类简化你的代码!

    在最近的项目中,由于要用到自定义分页的功能,本人就在网上找了个存储过程.结合C#写了个分页类.由于本人第一次写文章.写得不好,大家不要扔鸡蛋.. 下面是存储过程(sqlserver2000下通过) - ...

  3. phppage类封装分页功能_php显示页码分页类的封装

    本文实例为大家分享了php封装显示页码的分页类,供大家参考,具体内容如下 一.代码 conn.php class Mysql{ public function __construct(){ $this ...

  4. php显示固定页码,php显示页码分页类的封装

    搜索热词 本文实例为大家分享了PHP封装显示页码的分页类,供大家参考,具体内容如下 一.代码 conn.PHP PHP;"> connect(); } public function ...

  5. PHP面向对象(OOP)----分页类

    PHP面向对象(OOP)----分页类 同验证码类,分页也是在个人博客,论坛等网站中不可缺少的方式,通过分页可以在一个界面展示固定条数的数据,而不至于将所有数据全部罗列到一起,实现分页的原理其实就是对 ...

  6. PHP面向对象(OOP)----分页类 1

    同验证码类,分页也是在个人博客,论坛等网站中不可缺少的方式,通过分页可以在一个界面展示固定条数的数据,而不至于将所有数据全部罗列到一起,实现分页的原理其实就是对数据库查询输出加了一个limit限制,接 ...

  7. PHP数据库操作分页类

    MySQL数据库操作类: 1 <?php 2 class mysql { 3 private $db_host; //数据库主机 4 private $db_user; //数据库用户名 5 p ...

  8. php面向对象分页,PHP基于面向对象封装的分页类示例

    本文实例讲述了php基于面向对象封装的分页类.分享给大家供大家参考,具体如下: class page { protected $num;//每页显示条数 protected $total;//总记录数 ...

  9. Thinkphp5 自定义分页类

    1.在extend\目录下创建page目录,在page目录中创建Page.php文件,将以下代码放入文件中 <?php namespace page; use think\Paginator; ...

最新文章

  1. vCenter Server管理:[2]创建只读账户
  2. ABAP Text表的实现原理
  3. HashMap默认大小和扩容后的大小
  4. wps怎么投递简历发到boss直聘_BOSS直聘角逐招聘季:装机量、下载增量、增长率三料冠军...
  5. BZOJ 2527 Meteors | 整体二分
  6. decbin php,PHP decbin()函数
  7. PostgreSQL 的 window函数
  8. javascript(JS)混淆工具
  9. Eclipse JEE Mars 2 配置 WSO2 ESB 5.0.0 环境
  10. 旅行,写作,编程 :IT文艺青年的生活态度
  11. html中设置粗斜体,HTML基础 b i 字体加粗 斜体
  12. abaqus截面惯性矩_Abaqus基本概念汇总
  13. [webView stopLoading]; 和 [webView release];
  14. 【Linux】嵌入式Linux系统的移植(下篇:BootLoader,以U-Boot为例)
  15. Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
  16. Security注解:@PreAuthorize,@PostAuthorize, @Secured, EL实现方法安全
  17. 用 wingrub 引导Linux安装详述
  18. 从《流浪地球》撤资?——“数据思维”害的
  19. Window Media Player 播放器
  20. c++画蛋糕_poj1190 生日蛋糕 dfs

热门文章

  1. linux对于大文件的解压方法
  2. 数据处理程序语言中的基本数据类型
  3. JSP针织生产管理系统
  4. java序列化和RMI
  5. 选择scrum任务看板管理工具的要点
  6. 一份完整的聚合支付中心设计方案!
  7. Redis 日志篇:无畏宕机快速恢复的杀手锏
  8. 万字长文,结合电商支付业务一文搞懂DDD
  9. 阿里一面:如何保证API接口数据安全?
  10. 面向领域的微服务架构