Pagination
in package
Creates pagination for front-end tables.
Tags
Table of Contents
Properties
- $current_page : int
- The current page.
- $paginated_items : array<string|int, mixed>
- The paginated items.
- $per_page : int
- The number of items per page.
- $total_pages : int
- The total number of pages.
Methods
- __construct() : mixed
- Constructor method.
- controls() : string
- Generates pagination controls.
Properties
$current_page
The current page.
public
int
$current_page
$paginated_items
The paginated items.
public
array<string|int, mixed>
$paginated_items
$per_page
The number of items per page.
public
int
$per_page
= 10
Defaults to 10.
$total_pages
The total number of pages.
public
int
$total_pages
Methods
__construct()
Constructor method.
public
__construct(array<string|int, mixed> $items[, array<string|int, mixed> $args = null ]) : mixed
Parameters
- $items : array<string|int, mixed>
-
The array of items to paginate.
- $args : array<string|int, mixed> = null
-
An optional array of args. { @type int $per_page The number of items per page. Defaults to 10.}
Tags
controls()
Generates pagination controls.
public
controls() : string
Return values
string —The HTML for the pagination controls.