PHP Classes

Alt PHP Paginator: Generate pagination controls for Web pages

Recommend this page to a friend!
  Info   View files Example   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 223 This week: 1All time: 8,220 This week: 89Up
Version License PHP version Categories
paginator-alt 1.0.1Artistic License5HTML, PHP 5, Wireless and Mobile
Description 

Author

This class can generate pagination controls for desktop or mobile Web pages.

It takes as parameters that define the total number of items in a listing, the limit number of items per page, the number of the current page and text strings for the navigation controls.

The class can generate HTML for the pagination listing controls. It uses links for desktop and form select inputs that show pull down menus in mobile Web pages.

The package also comes versions of the class in JavaScript and Python.

Picture of Nikos M.
Name: Nikos M. is available for providing paid consulting. Contact Nikos M. .
Classes: 17 packages by
Country: Greece Greece
Age: 47
All time rank: 8609 in Greece Greece
Week rank: 91 Up2 in Greece Greece Up
Innovation award
Innovation award
Nominee: 7x

Winner: 2x

Example

<?php
require(dirname(__FILE__).'/../src/php/Paginator.php');

function
echo_($s)
{
    echo( ((string)
$s) . PHP_EOL . PHP_EOL);
}

echo_('Paginator.VERSION = ' . Paginator::VERSION . "\n");

$p1 = new Paginator(100, 10);

$p2 = (new Paginator(1000, 10, 3))
    ->
previousText('Prev')
    ->
nextText('Next')
    ->
placeholder('{page}')
    ->
urlPattern('/category/{page}')
;

$p3 = new Paginator(100, 10, 2);

echo_($p1);

echo_($p2);

echo_($p3);

echo_($p1->view('mobile'));

echo_($p2->view('mobile'));

echo_($p3->view('mobile'));


Details

Paginator

Simple and versatile Pagination utility class for PHP, Python, Node.js / Browser Javascript

adapted and extended from https://github.com/jasongrimes/php-paginator

see also:

  • ModelView a simple, fast, powerful and flexible MVVM framework for JavaScript
  • tico a tiny, super-simple MVC framework for PHP
  • LoginManager a simple, barebones agnostic login manager for PHP, JavaScript, Python
  • SimpleCaptcha a simple, image-based, mathematical captcha with increasing levels of difficulty for PHP, JavaScript, Python
  • Dromeo a flexible, and powerful agnostic router for PHP, JavaScript, Python
  • PublishSubscribe a simple and flexible publish-subscribe pattern implementation for PHP, JavaScript, Python
  • Importer simple class &amp; dependency manager and loader for PHP, JavaScript, Python
  • Contemplate a fast and versatile isomorphic template engine for PHP, JavaScript, Python
  • HtmlWidget html widgets, made as simple as possible, both client and server, both desktop and mobile, can be used as (template) plugins and/or standalone for PHP, JavaScript, Python (can be used as plugins for Contemplate)
  • Paginator simple and flexible pagination controls generator for PHP, JavaScript, Python
  • Formal a simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
  • Dialect a cross-vendor &amp; cross-platform SQL Query Builder, based on GrammarTemplate, for PHP, JavaScript, Python
  • DialectORM an Object-Relational-Mapper (ORM) and Object-Document-Mapper (ODM), based on Dialect, for PHP, JavaScript, Python
  • Unicache a simple and flexible agnostic caching framework, supporting various platforms, for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python

Usage

see tests under /test folder


  Files folder image Files  
File Role Description
Files folder imagesrc (3 directories)
Files folder imagetest (6 files)
Accessible without login Plain text file README.md Data Read me

  Files folder image Files  /  src  
File Role Description
Files folder imagejs (2 files)
Files folder imagephp (1 file)
Files folder imagepython (1 file)

  Files folder image Files  /  src  /  js  
File Role Description
  Accessible without login Plain text file Paginator.js Data Auxiliary data
  Accessible without login Plain text file Paginator.min.js Data Auxiliary data

  Files folder image Files  /  src  /  php  
File Role Description
  Plain text file Paginator.php Class Class source

  Files folder image Files  /  src  /  python  
File Role Description
  Accessible without login Plain text file Paginator.py Data Auxiliary data

  Files folder image Files  /  test  
File Role Description
  Accessible without login Plain text file out-js Data Auxiliary data
  Accessible without login Plain text file out-php Data Auxiliary data
  Accessible without login Plain text file out-py Data Auxiliary data
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Example Example script
  Accessible without login Plain text file test.py Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:223
This week:1
All time:8,220
This week:89Up