Download the PHP package rancoud/pagination without Composer
On this page you can find all versions of the php package rancoud/pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pagination
Pagination Package
Generate HTML pagination for accessibility.
Dependencies
Security package: https://github.com/rancoud/Security
Installation
How to use it?
It will output
Lexicon
- Root represents
<ul>
- Item represents
<li>
- Link represents
<a>
Pagination Constructor
Settings
Optionnals
Parameter | Type | Default value | Description |
---|---|---|---|
configuration | array | [] | Parameters for changing pagination behavior |
Pagination Methods
General Commands
- generateHtml(currentPage: int, countElements: int, countElementPerPage: int): string
- generateData(currentPage: int, countElements: int, countElementPerPage: int): array
Static methods
- countPages(countElements: int, countElementPerPage: int): int
- locateItemInPage(countElementPerPage: int, indexItem: int): int
Configuration Parameters
Url
- url (string) (example)
Behavior
- show_all_links (bool: false) (example)
- use_previous (bool: false) (example)
- always_use_previous (bool: false) (example)
- use_next (bool: false) (example)
- always_use_next (bool: false) (example)
- use_dots (bool: false) (example)
- count_pages_pair_limit (int: 0) (example)
- count_pages_pair_adjacent (int: 2) (example)
Labels
- text_previous (string: Previous page) (example)
- text_next (string: Next page) (example)
- text_dots (string: …) (example)
- text_page (string: {{PAGE}}) (example)
- aria_label_link (string: Goto page {{PAGE}}) (example)
- aria_label_current_link (string: Current page, page {{PAGE}}) (example)
- aria_label_nav (string: Pagination) (example)
- aria_label_previous (string: Previous page) (example)
- aria_label_next (string: Next page) (example)
- thousands_separator (string) (example)
HTML markup
Root
- root_tag (string: ul) (example)
- root_attrs (string) (example)
- use_nav (bool: true) (example)
- nav_attrs (string) (example)
Item
- item_tag (string: li) (example)
- item_attrs (string) (example)
- item_attrs_current (string) (example)
- item_previous_attrs (string) (example)
- item_previous_attrs_disabled (string) (example)
- item_next_attrs (string) (example)
- item_next_attrs_disabled (string) (example)
- item_dots_attrs (string) (example)
Link
- link_tag (string: a) (example)
- link_attrs (string) (example)
- link_attrs_current (string) (example)
- link_previous_attrs_disabled (string) (example)
- link_next_attrs_disabled (string) (example)
- dot_tag (string: span) (example)
- dot_attrs (string) (example)
Indentation
- use_pretty_html (bool: true) (example)
- html_tab_sequence (string: \t) (example)
- html_initial_indentation (int: 0) (example)
Security
- esc_attr (bool: true) (example)
- esc_html (bool: true) (example)
- charset (string: UTF-8) (example)
You have to sanitize by yourself thoses parameters:
- nav_attrs
- root_attrs
- item_attrs
- item_attrs_current
- item_previous_attrs
- item_previous_attrs_disabled
- item_next_attrs
- item_next_attrs_disabled
- item_dots_attrs
- link_attrs
- link_attrs_current
- link_previous_attrs_disabled
- link_next_attrs_disabled
- dot_attrs
- html_tab_sequence
Examples
url
Page append at the end
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
After page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / Url
show_all_links
Input
Output
⏫ Configuration Parameters / Behavior
use_previous
Input
Output
⏫ Configuration Parameters / Behavior
always_use_previous
Previous has aria-disabled=true
on link tag if there is no previous page
Input
Output
⏫ Configuration Parameters / Behavior
use_next
Input
Output
⏫ Configuration Parameters / Behavior
always_use_next
Next has aria-disabled=true
on link tag if there is no next page
Input
Output
⏫ Configuration Parameters / Behavior
use_dots
Input
Output
⏫ Configuration Parameters / Behavior
count_pages_pair_limit
Input
Output
⏫ Configuration Parameters / Behavior
count_pages_pair_adjacent
Input
Output
⏫ Configuration Parameters / Behavior
count_pages_pair_adjacent + count_pages_pair_adjacent
count_pages_pair_limit 0 + count_pages_pair_adjacent 0
Input
Output
count_pages_pair_limit 2 + count_pages_pair_adjacent 2
Input
Output
⏫ Configuration Parameters / Behavior
text_previous
Input
Output
⏫ Configuration Parameters / Labels
text_next
Input
Output
⏫ Configuration Parameters / Labels
text_dots
Input
Output
⏫ Configuration Parameters / Labels
text_page
Page append at the end
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / Labels
aria_label_link
Input
Output
With {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / Labels
aria_label_current_link
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / Labels
aria_label_nav
Input
Output
⏫ Configuration Parameters / Labels
aria_label_previous
Input
Output
⏫ Configuration Parameters / Labels
aria_label_next
Input
Output
⏫ Configuration Parameters / Labels
thousands_separator
Input
Output
⏫ Configuration Parameters / Labels
root_tag
Input
Output
⏫ Configuration Parameters / HTML markup / Root
root_attrs
Input
Output
⏫ Configuration Parameters / HTML markup / Root
use_nav
Input
Output
⏫ Configuration Parameters / HTML markup / Root
nav_attrs
Input
Output
⏫ Configuration Parameters / HTML markup / Root
item_tag
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_attrs
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_attrs_current
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_previous_attrs
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_previous_attrs_disabled
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_next_attrs
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_next_attrs_disabled
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Item
item_dots_attrs
Input
Output
⏫ Configuration Parameters / HTML markup / Item
link_tag
Input
Output
⏫ Configuration Parameters / HTML markup / Link
link_attrs
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Link
link_attrs_current
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Link
link_previous_attrs_disabled
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Link
link_next_attrs_disabled
Input
Output
Page replace with {{PAGE}} pattern
Input
Output
⏫ Configuration Parameters / HTML markup / Link
dot_tag
Input
Output
⏫ Configuration Parameters / HTML markup / Link
dot_attrs
Input
Output
⏫ Configuration Parameters / HTML markup / Link
use_pretty_html
Input
Output
⏫ Configuration Parameters / HTML markup / Indentation
html_tab_sequence
Input
Output
⏫ Configuration Parameters / HTML markup / Indentation
html_initial_indentation
Input
Output
⏫ Configuration Parameters / HTML markup / Indentation
esc_attr
Input
Output
⏫ Configuration Parameters / HTML markup / Security
esc_html
Input
Output
⏫ Configuration Parameters / HTML markup / Security
charset
Input
Output
⏫ Configuration Parameters / HTML markup / Security
generateData output
How to Dev
composer ci
for php-cs-fixer and phpunit and coverage
composer lint
for php-cs-fixer
composer test
for phpunit and coverage