2017 © Pedro Peláez
 

library ohpage

OhPage is a paginating library for PHP

image

rogerthomas84/ohpage

OhPage is a paginating library for PHP

  • Thursday, September 3, 2015
  • by rogerthomas84
  • Repository
  • 0 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

OhPage

OhPage is a simple cheat, really it's because I'm tired of figuring out the skip / limit for paginating result sets., (*1)

Latest Stable Version Total Downloads Latest Unstable Version License Build Status, (*2)

Using Composer

To use OhPage with Composer, add the dependency (and version constraint) to your require block inside your composer.json file., (*3)

{
    "require": {
        "rogerthomas84/ohpage": "1.0.*"
    }
}

Quick Start

<?php
$db = new \MongoClient('mongodb://my.database.host:27017'); // Set up your database connection
$collection = $db->selectCollection('mydb', 'mycollection');

$perPage = 10; // How many results per page?
$currentPage = 1; // The current page
$totalResults = $collection->count(); // Get the total from the DB

$instance = new PaginateHelper($perPage, $currentPage, $totalResults);

$results = $collection->find()->sort(
    array('createdDate' => -1)
)->skip(
    $instance->getQueryOffset()
)->limit(
    $instance->getQueryLimit()
);

The Versions

03/09 2015

dev-master

9999999-dev https://github.com/rogerthomas84/ohpage

OhPage is a paginating library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

paginator php pagination ohpage php page library

02/09 2015

1.0.0

1.0.0.0 https://github.com/rogerthomas84/ohpage

OhPage is a paginating library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

paginator php pagination ohpage php page library