2017 © Pedro Peláez
 

library pagination

this is universal package template for development and testing and composer distribution

image

zver/pagination

this is universal package template for development and testing and composer distribution

  • Tuesday, May 2, 2017
  • by s4urp8n
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Pagination

Universal pagination class, (*1)

Install

composer require zver/pagination

Usage

<?php

use Zver\Pagination;

Pagination::create()

          /**
          * Array or PaginationInterface implemented class
          */
          ->setItems([1,2,3,4,5,6])

          /**
          * Items per page
          */
          ->setItemsPerPage(20)

          /**
          * Here you must define URL generation callback.
          */
          ->setPageUrlCallback(
              function ($number)
              {
                  /**
                  * For example
                  */
                  return "/items?page=" . $number;
              }
          )

          /**
          * Here you must define callback which returns current page number.
          */
          ->setCurrentPageCallback(
              function ()
              {
                  /**
                  * For example
                  */

                  if(isset($_GET['page']) && is_numeric($_GET['page']))
                  {
                    return $_GET['page'];
                  }

                  return 1;
              }
          )

          /**
          * Here you can render items html as you want.
          */
          ->showItems(
              function ($items, Pagination $pagination)
              {

              }
          )

          /**
          * Here you can render pages html as you want.
          * Callback will executed only if pages count > 1
          */
          ->showPages(
              function ($pages, Pagination $pagination)
              {

              }
);

The Versions

02/05 2017

dev-master

9999999-dev

this is universal package template for development and testing and composer distribution

  Sources   Download

The Requires

 

02/05 2017

1.0.3

1.0.3.0

this is universal package template for development and testing and composer distribution

  Sources   Download

The Requires

 

08/04 2017

1.0.2

1.0.2.0

this is universal package template for development and testing and composer distribution

  Sources   Download

The Requires

 

07/08 2016

1.0.1

1.0.1.0

universal customizable pagination

  Sources   Download

30/07 2016

1.0.0

1.0.0.0

universal customizable pagination

  Sources   Download