PHP Classes

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

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 131 This week: 1All time: 9,328 This week: 560Up
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: 40
All time rank: 234140 in Turkey Turkey
Week rank: 416 Up9 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  
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

 Version Control Unique User Downloads Download Rankings  
 66%
Total:131
This week:1
All time:9,328
This week:560Up