Paginator
in package
Simple pagination with numbers
Tags
Table of Contents
Properties
- $buttons : array<string, array<string, string|null>>
- $current : int
- $divide : string
- $mark : string
- $maxPage : int
- $perPage : int
- $total : int
Methods
- __construct() : mixed
- getCurrent() : int
- Get current page
- getOffset() : int
- Get offset start form sql
- getPager() : string
- Get pager
- getPerPage() : int
- Get number of records per page
- getSql() : string
- Get formatted LIMIT for database request
- getTotal() : int
- Get total number of records
- setTotal() : void
- Set total number of records
- getBtnLink() : string
- Get custom style for links with text
- loadCurrent() : void
- Load current page
Properties
$buttons
public
static array<string, array<string, string|null>>
$buttons
= ['first' => ['CLASS' => null, 'NAME' => '<<'], 'prev' => ['CLASS' => null, 'NAME' => '<'], 'next' => ['CLASS' => null, 'NAME' => '>'], 'last' => ['CLASS' => null, 'NAME' => '>>']]
$current
protected
int
$current
$divide
protected
string
$divide
$mark
protected
string
$mark
$maxPage
protected
int
$maxPage
$perPage
protected
int
$perPage
$total
protected
int
$total
Methods
__construct()
public
__construct([int $perPage = 20 ][, string $mark = 'page' ][, int $maxPage = 0 ][, string $divide = ' | ' ]) : mixed
Parameters
- $perPage : int = 20
- $mark : string = 'page'
- $maxPage : int = 0
- $divide : string = ' | '
getCurrent()
Get current page
public
getCurrent() : int
Return values
intgetOffset()
Get offset start form sql
public
getOffset() : int
Return values
intgetPager()
Get pager
public
getPager(string $pageUrl) : string
Parameters
- $pageUrl : string
Return values
stringgetPerPage()
Get number of records per page
public
getPerPage() : int
Return values
intgetSql()
Get formatted LIMIT for database request
public
getSql() : string
Return values
stringgetTotal()
Get total number of records
public
getTotal() : int
Return values
intsetTotal()
Set total number of records
public
setTotal(int $total) : void
Parameters
- $total : int
getBtnLink()
Get custom style for links with text
protected
getBtnLink(array<string, string|null> $btn) : string
Parameters
- $btn : array<string, string|null>
Return values
stringloadCurrent()
Load current page
protected
loadCurrent() : void