2017 © Pedro Peláez
 

library paginator

Pagination class for PHP

image

tommylykerin/paginator

Pagination class for PHP

  • Friday, July 20, 2018
  • by tommylykerin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP-Paginator

A simple pagination class for PHP, (*1)

Installation

 composer require tommylykerin/php-paginator

include composer's autoload.php file in your project., (*2)

Option 2: Clone

Clone or Download the project to your computer include the Paginator.php file in your project., (*3)

Usage

instantiate the Paginator class passing the total number of results as the first argument and the number of results per page as the second argument to the class constructor:, (*4)

$paginator = new Paginator(500, 5);

echo a call the paginate method:, (*5)

echo $paginator->paginate(); 

the URL is automatically generated based on the current URL in the address bar., (*6)

If you want to set custom URL, you should call the set_url() method passing the desired URL as the parameter:, (*7)

$paginator = new Paginator(500, 5);
$paginator->set_url("http://custom_url.com/?query=preserved");
echo $paginator->paginate();

This will append the page data to the set URL. The existing parameters in the URL are preserved. This example will produce: http://custom_url.com/?query=preserved&page=1, etc., (*8)

The Versions

20/07 2018

dev-master

9999999-dev

Pagination class for PHP

  Sources   Download

20/07 2018

v0.1.0

0.1.0.0

Pagination class for PHP

  Sources   Download