Pagination
class Pagination
Class that supports pagination for views.
Methods
__construct(int $currentPage = 1, int $limit = 10, int $totalItems = 0)
Constructor for Pagination class
static int|string
currentPage(object $request)
Retrieves current page from GET request.
int
offset()
Calculates offset needed for pagination.
static string
pagination(int $current_page, int $total_pages, string $base_url = '?page=')
Renders Bootstrap 5 pagination controls.
array
paginationParams(mixed $conditions, array $bind = [], string $order)
Builds parameters for pagination query.
int
totalPages()
Returns total number of pages we need to handle.
Details
at line 20
__construct(int $currentPage = 1, int $limit = 10, int $totalItems = 0)
Constructor for Pagination class
at line 32
static int|string
currentPage(object $request)
Retrieves current page from GET request.
at line 42
int
offset()
Calculates offset needed for pagination.
at line 55
static string
pagination(int $current_page, int $total_pages, string $base_url = '?page=')
Renders Bootstrap 5 pagination controls.
at line 114
array
paginationParams(mixed $conditions, array $bind = [], string $order)
Builds parameters for pagination query.
at line 129
int
totalPages()
Returns total number of pages we need to handle.