GithubHelp home page GithubHelp logo

jkisioh / php-pagination Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onassar/php-pagination

0.0 0.0 0.0 159 KB

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.

Home Page: http://web.onassar.com/blog/2012/06/09/github-project-php-pagination/

php-pagination's Introduction

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();

php-pagination's People

Contributors

onassar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.