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.
PHP CSS
Switch branches/tags
Nothing to show
Clone or download
Latest commit 3e23667 Dec 15, 2017
Permalink
Failed to load latest commit information.
themes Markup tweaks to make compataible with Twitter Bootstrap Oct 11, 2012
.gitignore Binary image Jul 25, 2012
LICENSE Create LICENSE Apr 28, 2016
Pagination.class.php Docs Dec 15, 2017
README.md Update README.md Jan 8, 2012
render.inc.php Docs Dec 15, 2017

README.md

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

    // determine page (based on <_GET>)
    $page = isset($_GET['page']) ? ((int) $_GET['page']) : 1;

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

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