Download the PHP package molajo/pagination without Composer
On this page you can find all versions of the php package molajo/pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download molajo/pagination
More information about molajo/pagination
Files in molajo/pagination
Package pagination
Short Description Pagination Rendering for PHP Applications
License MIT
Homepage http://github.com/Molajo/Pagination
Informations about the package pagination
======= Molajo Pagination
Provides easy pagination data for any PHP application.
At a glance ...
- Get the
page_url
,query parameters
andstart
value from your preferredHttp Request Class.
- Run a query (or produce a list of items) using normal
offset
androw limit
criteria. - Instantiate the
Molajo\Pagination
class, injecting it with the data and various pagination values. - Use the pagination data object to render the pagination interface.
Detailed Example
The following is from a working example of a Pagination View located in in the .dev/Sample folder. To see the demo on your local website, create an Apache Host using the Public Folder as the Disk Location. Then, use the Server Name as the address in your browser.
Pagination Output
The Pagination getPaginationData
method returns a data object of the following data elements that
correspond to this mock-up of a rendered view.
A << <<
- $row->first_page_number
- $row->first_page_link
B <<
- $row->previous_page_number
- $row->previous_page_link
C Used to loop through page links 1 2 3 4 5
- $row->start_links_page_number
- $row->stop_links_page_number
- $row->page_links_array
D >>
- $row->next_page_number
- $row->next_page_link
E >> >>
- $row->last_page_number
- $row->last_page_link
Additional data provided by the method:
- $row->current_start_parameter_number
- $row->current_start_parameter_link
- $row->total_items
Example View
The following View is part of the Example to demonstrate how to use the pagination data for rendering.
Install using Composer from Packagist
Step 1: Install composer in your project
Step 2: Create a composer.json file in your project root
Step 3: Install via composer
Requirements and Compliance
- PHP framework independent, no dependencies
- Requires PHP 5.4, or above
- Semantic Versioning
- Compliant with:
- [phpDocumentor2] (https://github.com/phpDocumentor/phpDocumentor2)
- [phpUnit Testing] (https://github.com/sebastianbergmann/phpunit)
- Author AmyStephen
- [Travis Continuous Improvement] (https://travis-ci.org/profile/Molajo)
- Listed on [Packagist] (https://packagist.org/packages/molajo/pagination) and installed using [Composer] (http://getcomposer.org/)
- Use github to submit pull requests and features
- Licensed under the MIT License - see the
LICENSE
file for details
All versions of pagination with dependencies
commonapi/render Version dev-master
commonapi/exception Version dev-master