pagination() html()
A pager from page => link pairs with Prev / Next.
html()->pagination($data = [], $extra = [])Options
| Option | Meaning |
|---|---|
$data | Page => link, plus prev and next links. |
size | sm or lg. |
align | center or end (right). |
current, disabled | Current page; pages shown disabled (prev, next too). |
class, id | Classes; id. |
Example
Code
return html()->pagination(['1' => '#page-1', '2' => '#page-2', 'prev' => '#page-1', 'next' => '#page-3', '3' => '#page-3', '4' => '#page-4', '5' => '#page-5'], ['current' => 2, 'align' => 'center']);Notes
- For paging a result set use
common()->divide_pages()(the table2 pager), which renders through this widget; see the pagination demo.
Bootstrap 3 and 5
Bootstrap 3 pagination; Bootstrap 5 page-item / page-link.
See also: demo:html/pagination, table/render