2017 © Pedro Peláez
 

library pagee

stand alone php paginator

image

maeharin/pagee

stand alone php paginator

  • Wednesday, July 3, 2013
  • by maeharin
  • Repository
  • 1 Watchers
  • 1 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Pagee(ver 0.x)

independent PHP pagination library, (*1)

what?

  • independent from any other library, works stand alone
  • generate limit and offset for sql
  • generate links for pagination

usage

first: set, (*2)

// requested url: http://www.hoge.com/users.php?page=3
// total_count: the results of 'select count(*) from users;'
$pagee = Pagee::create(array(
    'base_url'       => 'http://www.hoge.com/users.php',
    'total_count'    => 100,
    'requested_page' => 3
));

second: find this page's records, (*3)

$sql = "
    SELECT
        *
    FROM
        users
    LIMIT
        {$pagee->limit()}
    OFFSET
        {$pagee->offset()}
";

throd: generate pagination links, (*4)

$pagee->links();

customize setting

$pagee = Pagee::create(array(
            'base_url'       => 'http://www.hoge.com/answers.php',
            'total_count'    => 100,
            'requested_page' => 3
        ))
        ->append_params(array(
            'project_id' => 100,
            'user_type' => 'hoge'
        ));

$pagee->links();

install

download composer, (*5)

$ curl -sS https://getcomposer.org/installer | php

composer.json, (*6)

{
    "require": {
        "maeharin/pagee": "dev-master"
    }
}

install, (*7)

$ php composer.phar install

todo

  • i18n

The Versions

03/07 2013

dev-master

9999999-dev https://github.com/maeharin/pagee

stand alone php paginator

  Sources   Download

MIT

The Development Requires

by Avatar maeharin

pagination paginator pager