Download the PHP package ucscode/easy-paginator without Composer
On this page you can find all versions of the php package ucscode/easy-paginator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ucscode/easy-paginator
More information about ucscode/easy-paginator
Files in ucscode/easy-paginator
Package easy-paginator
Short Description A lightweight and flexible PHP pagination library for handling paginated data and generating pagination links.
License MIT
Homepage http://github.com/ucscode/easy-paginator
Informations about the package easy-paginator
Easy Paginator
Ucscode Paginator is a lightweight PHP pagination library designed to handle paginated data efficiently. It provides an easy-to-use interface for managing and generating pagination links.
This project requires a minimum of PHP 8.2
Installation
Install the package via Composer:
Usage
Creating a Paginator
Getting Pagination Information
Generating URLs
Pagination Builder
The Builder
class generates an array of Item
, which can be iterated to display page links.
Example
Pagination Items
The Builder::getItems()
generates an array of Item
:
Where an Item
contains getters and setters for the following properties:
For structured HTML generation, use can still use the Builder
. This class converts pagination data into an HTML structure with ul
and li
elements, making it easy to integrate into any UI.
Example Usage
The will generate HTML similar to bootstrap 5 pagination:
Updating the HTML Element
You can customize the HTML Element before rendering it by taking advantage of the UssElement Library.
Checkout UssELement and read the official documentation for more details
Acknowledgement
Inspired by jasongrimes/php-paginator
Licence
Easy Paginator is licensed under the MIT License.