PHP Classes

PHP Pagination class: Generate HTML to display links for pagination

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: 207 All time: 8,406 This week: 73Up
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: 23
All time rank: 84310 in Pakistan Pakistan
Week rank: 44 Up1 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 (6)  
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 (6)  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files (6)  /  src  
File Role Description
  Plain text file Pagination.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  
 100%
Total:207
This week:0
All time:8,406
This week:73Up