Download the PHP package popphp/pop-paginator without Composer
On this page you can find all versions of the php package popphp/pop-paginator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download popphp/pop-paginator
More information about popphp/pop-paginator
Files in popphp/pop-paginator
Package pop-paginator
Short Description Pop Paginator Component for Pop PHP Framework
License BSD-3-Clause
Homepage https://github.com/popphp/pop-paginator
Informations about the package pop-paginator
pop-paginator
- Overview
- Install
- Quickstart
- Page Range
- Page Form
- Options
Overview
pop-paginator
is a component for handling pagination for large data sets.
You can set multiple options to control the display of the pages and the links.
pop-paginator
is a component of the Pop PHP Framework.
Install
Install pop-paginator
using Composer.
composer require popphp/pop-paginator
Or, require it in your composer.json file
"require": {
"popphp/pop-paginator" : "^4.0.1"
}
Top
Quickstart
Which will produce this HTML:
And if you clicked on page 3, it would render:
Top
Page Range
In the above example, a page range object renders a range of page links. With it, you can set a large number of pages and have it render "bookend" link before and after the range as the "previous" and "next" links. Pass the total number of items, the per page limit and the range limit:
If we go to page 12, it would render:
As you can see, it renders the "bookends" to navigate to the next set of pages, the previous set, the beginning or end of the set.
Top
Page Form
To have a cleaner way of displaying a large set of pages, you can use the form object, which renders a input form field.
This will produce:
So instead of a set a links in between the bookends, there is a form input field that will allow the user to input a specific page to jump to.
Top
Options
You can set many options to tailor the paginator object's look and functionality:
- Number of items per page
- Range of the page sets
- Separator between the page links
- Classes for the on/off page links
- Bookend characters
- start
- previous
- next
- end
The start
is the far left bookend that takes you back to the beginning.
The previous
is the left bookend that takes you to the previous page set.
The next
is the right bookend that takes you to the next page set.
The end
is the far right bookend that takes you all the way to the end.
Top