PHP Classes

PHP Pagination Library: Display pagination links for listings on Web pages

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 132 All time: 9,329 This week: 131Up
Version License PHP version Categories
pagi 1.0The PHP License5HTML, PHP 5, Content management
Description 

Author

This class can display pagination links for listings on Web pages.

It can take as parameters the total number of entries of a listing to display on a page and the name of a variable that it will use to pass the number of the current page of the listing to show.

The class generates HTML for the pagination links with the presentation customized with CSS styles.

Picture of Kemal GENIS
  Performance   Level  
Name: Kemal GENIS <contact>
Classes: 7 packages by
Country: Turkey Turkey
Age: 41
All time rank: 233340 in Turkey Turkey
Week rank: 195 Up8 in Turkey Turkey Up

Example

<style>
ul.pagination {
    display:block;
    text-align:center;
    padding:0;
    margin:0;
    }
   
ul.pagination > li {
    display:inline-block;
    }
   
ul.pagination > li > a, ul.pagination > li > span, ul.pagination > li > span.spacer {
    display:inline-block;
    min-width:15px;
    margin:2px 0.5px;
    text-decoration:none;
    color:#333;
    font-family:Trebuchet MS;
    font-size:13px;
    background:#eee;
    border:1px solid #666;
    padding:4px;
    border-radius:5px;
    }
   
ul.pagination > li > span {
    background:#ad0;
    }
   
ul.pagination > li > a:hover {
    color:#333; background:#de9;
    }
</style>

<?php
include_once "pagination.class.php";
$pagi = new Pagi(3, 'page');
echo
$pagi->getContent();
echo
"\n<br>";

$pagi->setTotalPage(25);
echo
$pagi->getContent();
echo
"\n<br>";

$pagi->setPageLimit(5);
echo
$pagi->getContent();
echo
"\n<br>";
?>


  Files folder image Files (3)  
File Role Description
Plain text file index.php Example Example script
Image file pagi.png Screen Screenshot
Plain text file pagination.class.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 66%
Total:132
This week:0
All time:9,329
This week:131Up