Range
extends AbstractPaginator
in package
Paginator range of links class
Tags
Table of Contents
Properties
- $bookends : array<string|int, mixed>
- Page bookends
- $classOff : string|null
- Class 'off' name for page link tags
- $classOn : string|null
- Class 'on' name for page link tags
- $currentPage : int
- Current page property
- $end : int|null
- Current page end index property
- $links : array<string|int, mixed>
- Page links property
- $numberOfPages : int|null
- Number of pages property
- $perPage : int
- Number of items per page
- $queryKey : string
- Query key
- $range : int
- Range of pages per page
- $separator : string|null
- Link separator
- $start : int|null
- Current page start index property
- $total : int
- Total number of items
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Output the rendered page links
- calculateRange() : array<string|int, mixed>
- Calculate the page range
- createRange() : void
- Create links
- getBookend() : string|null
- Get a bookend
- getBookends() : array<string|int, mixed>
- Get the bookends
- getClassOff() : string
- Get the class 'off' name.
- getClassOn() : string
- Get the class 'on' name
- getCurrentPage() : int
- Get the current page
- getLinkRange() : array<string|int, mixed>
- Get the page links
- getNumberOfPages() : int
- Get the number of pages
- getPerPage() : int
- Get the per page
- getQueryKey() : string
- Get the query key
- getRange() : int
- Get the page range
- getSeparator() : string
- Get the bookend separator
- getTotal() : int
- Get the content items total
- setBookends() : AbstractPaginator
- Set the bookends
- setClassOff() : Range
- Set the class 'off' name.
- setClassOn() : Range
- Set the class 'on' name
- setQueryKey() : AbstractPaginator
- Set the query key
- setSeparator() : Range
- Set the bookend separator
- wrapLinks() : array<string|int, mixed>
- Wrap page links in an HTML node
Properties
$bookends
Page bookends
protected
array<string|int, mixed>
$bookends
= ['start' => '«', 'previous' => '‹', 'next' => '›', 'end' => '»']
$classOff
Class 'off' name for page link tags
protected
string|null
$classOff
= null
$classOn
Class 'on' name for page link tags
protected
string|null
$classOn
= null
$currentPage
Current page property
protected
int
$currentPage
= 1
$end
Current page end index property
protected
int|null
$end
= null
$links
Page links property
protected
array<string|int, mixed>
$links
= []
$numberOfPages
Number of pages property
protected
int|null
$numberOfPages
= null
$perPage
Number of items per page
protected
int
$perPage
= 10
$queryKey
Query key
protected
string
$queryKey
= 'page'
$range
Range of pages per page
protected
int
$range
= 10
$separator
Link separator
protected
string|null
$separator
= null
$start
Current page start index property
protected
int|null
$start
= null
$total
Total number of items
protected
int
$total
= 0
Methods
__construct()
Constructor
public
__construct(int $total[, int $perPage = 10 ][, int $range = 10 ]) : mixed
Instantiate the paginator object
Parameters
- $total : int
- $perPage : int = 10
- $range : int = 10
__toString()
Output the rendered page links
public
__toString() : string
Return values
stringcalculateRange()
Calculate the page range
public
calculateRange([int $page = 1 ]) : array<string|int, mixed>
Parameters
- $page : int = 1
Return values
array<string|int, mixed>createRange()
Create links
public
createRange([int $page = 1 ]) : void
Parameters
- $page : int = 1
getBookend()
Get a bookend
public
getBookend(string $key) : string|null
Parameters
- $key : string
Return values
string|nullgetBookends()
Get the bookends
public
getBookends() : array<string|int, mixed>
Return values
array<string|int, mixed>getClassOff()
Get the class 'off' name.
public
getClassOff() : string
Return values
stringgetClassOn()
Get the class 'on' name
public
getClassOn() : string
Return values
stringgetCurrentPage()
Get the current page
public
getCurrentPage() : int
Return values
intgetLinkRange()
Get the page links
public
getLinkRange([int|null $page = null ]) : array<string|int, mixed>
Parameters
- $page : int|null = null
Return values
array<string|int, mixed>getNumberOfPages()
Get the number of pages
public
getNumberOfPages() : int
Return values
intgetPerPage()
Get the per page
public
getPerPage() : int
Return values
intgetQueryKey()
Get the query key
public
getQueryKey() : string
Return values
stringgetRange()
Get the page range
public
getRange() : int
Return values
intgetSeparator()
Get the bookend separator
public
getSeparator() : string
Return values
stringgetTotal()
Get the content items total
public
getTotal() : int
Return values
intsetBookends()
Set the bookends
public
setBookends(array<string|int, mixed> $bookends) : AbstractPaginator
Parameters
- $bookends : array<string|int, mixed>
Return values
AbstractPaginatorsetClassOff()
Set the class 'off' name.
public
setClassOff(string $class) : Range
Parameters
- $class : string
Return values
RangesetClassOn()
Set the class 'on' name
public
setClassOn(string $class) : Range
Parameters
- $class : string
Return values
RangesetQueryKey()
Set the query key
public
setQueryKey(string $key) : AbstractPaginator
Parameters
- $key : string
Return values
AbstractPaginatorsetSeparator()
Set the bookend separator
public
setSeparator(string $sep) : Range
Parameters
- $sep : string
Return values
RangewrapLinks()
Wrap page links in an HTML node
public
wrapLinks(string $node[, string|null $classOn = null ][, string|null $classOff = null ]) : array<string|int, mixed>
Parameters
- $node : string
- $classOn : string|null = null
- $classOff : string|null = null