上一页 = 5 && $countPage >= $currentPage):?> ">1 ... = 1){ $index = (($currentPage-5)%3 == 0) ? ($currentPage-5)/3 + 1 : floor(($currentPage-5)/3 + 1); } $number = ">
输入banner图图片脚本导航/分类

javascript-新手在项目中模仿sg的分页器.求指点

 1):?>

    
        
    1):?>
  • ">上一页
  • = 5 && $countPage >= $currentPage):?>
  • ">1
  • ...
  • = 1){ $index = (($currentPage-5)%3 == 0) ? ($currentPage-5)/3 + 1 : floor(($currentPage-5)/3 + 1); } $number = 3 * $index + $i + 1; ?>
  • ">
  • ...
  • ">下一页
  • ">末页

我只拿到了四条数据,当前页,总页,上一页,下一页;
有没有别的写法 , 我想我这种很低劣吧

回复内容:

 1):?>

    
        
    1):?>
  • ">上一页
  • = 5 && $countPage >= $currentPage):?>
  • ">1
  • ...
  • = 1){ $index = (($currentPage-5)%3 == 0) ? ($currentPage-5)/3 + 1 : floor(($currentPage-5)/3 + 1); } $number = 3 * $index + $i + 1; ?>
  • ">
  • ...
  • ">下一页
  • ">末页

我只拿到了四条数据,当前页,总页,上一页,下一页;
有没有别的写法 , 我想我这种很低劣吧

使用Laravel做分页的输出,可以一行代码搞定,很优雅!具体参照它的API