PHP Classes

PHP Bootstrap Pagination: Display pagination links using Bootstrap styles

Recommend this page to a friend!
  Info   Example   Demos   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 659 All time: 4,885 This week: 47Up
Version License PHP version Categories
bootrap_pagination 1.0GNU General Publi...5.0HTML, PHP 5
Description 

Author

This class can display pagination links using Twitter Bootstrap CSS styles.

It takes as parameters the total number of records in a listing and the limit of records to display per page.

The class checks the current number of page and generates an HTML list with links to the paginated list pages using CSS styles of Twitter Bootstrap library.

Picture of Taiwo Peace
  Performance   Level  
Name: Taiwo Peace is available for providing paid consulting. Contact Taiwo Peace .
Classes: 3 packages by
Country: Nigeria Nigeria
Age: 30
All time rank: 16526 in Nigeria Nigeria
Week rank: 195 Up6 in Nigeria Nigeria Equal
Innovation award
Innovation award
Nominee: 1x

Example

<?php
//usage

//include mypagin.php;
 
require_once ('mypagin.php');

//for sql syntax to get total_record number
$sql = "SELECT COUNT(column_id) FROM tablename" ;
$total_records = $row [0];


 
 
//create a pagin class
 
$pagin=new simplepagin();
 
 
// assign variable values
 

$pagin->total_records=$total_records;
$pagin->noperpage=5;
//this would give example.php?page=1 url type
$pagin->url='example.php';
$pagin->val='page';
//pagin size (sm or lg )
//for default pagination size leave value empty like this $pagin->size=''
$pagin->size='sm';
//call the pagin function
$pagin->pagin();


  example outputExternal page  

Open in a separate window

Screenshots (2)  
  • pagin.JPG
  • paginlg.JPG
  Files folder image Files (4)  
File Role Description
Accessible without login Plain text file example.php Example example usage
Plain text file mypagin.php Class main pagination class

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  
 0%
Total:659
This week:0
All time:4,885
This week:47Up