pagination() html()

A pager from page => link pairs with Prev / Next.

html()->pagination($data = [], $extra = [])

Options

OptionMeaning
$dataPage => link, plus prev and next links.
sizesm or lg.
aligncenter or end (right).
current, disabledCurrent page; pages shown disabled (prev, next too).
class, idClasses; 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