Download the PHP package php-pagination/php-pagination without Composer
On this page you can find all versions of the php package php-pagination/php-pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-pagination/php-pagination
More information about php-pagination/php-pagination
Files in php-pagination/php-pagination
Package php-pagination
Short Description PHP Pagination Class with 4 types: Simple Pagination, Google Pagination, Digg/PHPBB Pagination Style.
License BSD-3-Clause
Informations about the package php-pagination
PHP Pagination
PHP paging class with 4 different page types:
Simple Pagination:
Creates a simple pagination similar to Google.PHPBB/Digg Pagination:
Paging in the same style as the PHPBB CMS/Digg. In addition to the normal pages you have the markers with the last pages and home pages.Jumping Pagination:
Paging where the markers "jump" after a certain value, for example: Every 10 page markers are displayed from 1 to 10 - 11 to 20 - 21 to 30 and so on.Google Pagination:
PHP paging is the same as that used by Google to display search results.
See the examples folder for using the class easily.
Features
v2.0.1
Added method to get start for sql clauses.v2.0.0
The methods were refactored, unit tests added, examples and design patters.
Important informations
-
You need PHP 7.0 or higher to use this class.
-
I used the strategy pattern to create different pagination types. I put the examples in the examples folder. This pagination returns only one PHP ArrayObject, so you create the layout part as you wish.
-
The pagination always returns the first page, last page, previous, next, an ArrayObject with total pages, 2 methods to advance or retreat a deternated number of pages and finally another ArrayObject with the markers following the paging style logic chosen.
- This is a free project, feel free to use it in your projects, even if they are commercial. You can also contribute tips, new features and fixes.
Example of use
To use this class you must follow the code below. Do not forget to access the examples folder here in the repository with the usage examples for each page type. Also access rafaacademy.com for tips and tutorials on php and use of this class.
Install: composer require php-pagination/php-pagination
To navigate between indexes you need to learn how to work with the ArrayInterator and ArrayObject of PHP.