PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Ujah Chigozie peter   Peter PHP Pagination Class   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Peter PHP Pagination Class
Generate HTML to navigate between listing pages
Author: By
Last change:
Date: 11 months ago
Size: 1,318 bytes
 

Contents

Class file image Download

PHP Pagination

Pagination is a simple pagging in php

Installation

Installation is super-easy via Composer:

composer require peterujah/pagination

USAGES

Hierarchical can be use as an array, html or google organizations chart

 use Peterujah\NanoBlock\Pagination;
 $paging = new Pagination($rowCount, Pagination::LIST);
 $paging = new Pagination($rowCount, Pagination::LINK);

Dump array

 $paging = new Pagination(100, Pagination::LIST);
 $paging->setLimit(20);
 $paging->setCurrentPage($_GET["page"]??1)->show();

 $paging = new Pagination(100, Pagination::LIST);
 $paging->setLimit(20);
 $html = $paging->setCurrentPage($_GET["page"]??1)->get();

Use built in css style, only work with $paging->show() method

$paging->setAllowCss(true);

Initalisation options new Pagination($rowCount, Pagination::LINK)

| Options | Description | |-----------------|-------------------------------------------------------------------------------------| | LIST | Retrieve result as an html list | | LINK | Retrieve result in HTML link |