PHP-Pagination

Simple and lightweight PHP pagination class that works with Twitter Bootstrap perfectly. Manages pagination variables through instantiable class, and markup rendering through view-like include file.

  • 所有者: onassar/PHP-Pagination
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

PHP Pagination

PHP-Pagination contains an instantiable class, along with a view which renders
the pagination markup.

The purpose of this library is to provide a simple API to render pagination
markup, without having to worry about including common files and set too many
settings. With this class, you simply pass in your parameters and make a call to
the instance's *<parse> method.

Pagination Instantiation and Rendering

<?php

    // source inclusion
    require_once APP . '/vendors/PHP-Pagination/Pagination.class.php';

    // set the page number (based on a URL param; cast as an int; ensure min page number)
    $page = $_GET['page'] ?? 1;
    $page = (int) $page;
    $page = min($page, 1);

    // instantiate; set current page; set number of records per page; number of records in total
    $pagination = new Pagination();
    $pagination->setCurrent($page);
    $pagination->setRPP(24);
    $pagination->setTotal(200);

    // grab rendered pagination markup
    $markup = $pagination->parse();

主要指标

概览
名称与所有者onassar/PHP-Pagination
主编程语言PHP
编程语言PHP (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2011-07-13 04:05:15
推送于2025-05-18 02:45:35
最后一次提交2025-05-17 22:45:33
发布数0
用户参与
星数125
关注者数7
派生数74
提交数38
已启用问题?
问题数8
打开的问题数3
拉请求数2
打开的拉请求数3
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?