PHP Classes

PHP Pagination class: Generate HTML to display links for pagination

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 205 This week: 1All time: 8,428 This week: 560Up
Version License PHP version Categories
php-pagination-class 1.0MIT/X Consortium ...5HTML, PHP 5
Description 

Author

This class can generate HTML to display links for pagination.

It takes as parameters the total number of entries in a listing to be split in pages, the limit number of entries to display in a page, the current page number and the base URL of the page.

The class can return HTML to display links to let the user go between the different pages of the listing.

The link presentation can be customized using CSS styles.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84611 in Pakistan Pakistan
Week rank: 51 Up3 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x

Example

<!-- Compiled and minified CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">

    <!-- Compiled and minified JavaScript -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
           

<?php
   
use Lablnet\Pagination;
    require
'../vendor/autoload.php';
   
$pag1 = new Pagination(100,10,5,'/');
    echo
$pag1->pagination();
   
$pag2 = new Pagination(1000,10,25,'https://example.com/blogs/');
    echo
$pag2->pagination();


Details

PHP Pagination

Simple pagination library implements a paging interface on collections of things.

Requirement

  • PHP
  • Composer

install

run this command


## usage

<!-- Compiled and minified CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"> <!-- Compiled and minified JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> <?php use Lablnet\Pagination; require '../vendor/autoload.php'; $pag1 = new Pagination(100,10,5,'/'); echo $pag1->pagination(); $pag2 = new Pagination(1000,10,25,'https://example.com/blogs/'); echo $pag2->pagination();



  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (1 file)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Read me

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:205
This week:1
All time:8,428
This week:560Up