Range
extends AbstractPaginator
in package
Paginator range of links class
Tags
Table of Contents
- $bookends : array<string|int, mixed>
- Page bookends
- $classOff : string
- Class 'off' name for page link tags
- $classOn : string
- Class 'on' name for page link tags
- $currentPage : int
- Current page property
- $end : int
- Current page end index property
- $links : array<string|int, mixed>
- Page links property
- $numberOfPages : int
- Number of pages property
- $perPage : int
- Number of items per page
- $queryKey : string
- Query key
- $range : int
- Range of pages per page
- $separator : string
- Link separator
- $start : int
- Current page start index property
- $total : int
- Total number of items
- __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
- 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() : int
- 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
$classOff
= null
$classOn
Class 'on' name for page link tags
protected
string
$classOn
= null
$currentPage
Current page property
protected
int
$currentPage
= 1
$end
Current page end index property
protected
int
$end
= null
$links
Page links property
protected
array<string|int, mixed>
$links
= []
$numberOfPages
Number of pages property
protected
int
$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
$separator
= null
$start
Current page start index property
protected
int
$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
Return values
mixed —__toString()
Output the rendered page links
public
__toString() : string
Return values
string —calculateRange()
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
Return values
void —getBookend()
Get a bookend
public
getBookend(string $key) : string
Parameters
- $key : string
Return values
string —getBookends()
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
string —getClassOn()
Get the class 'on' name
public
getClassOn() : string
Return values
string —getCurrentPage()
Get the current page
public
getCurrentPage() : int
Return values
int —getLinkRange()
Get the page links
public
getLinkRange([int $page = null ]) : array<string|int, mixed>
Parameters
- $page : int = null
Return values
array<string|int, mixed> —getNumberOfPages()
Get the number of pages
public
getNumberOfPages() : int
Return values
int —getPerPage()
Get the per page
public
getPerPage() : int
Return values
int —getQueryKey()
Get the query key
public
getQueryKey() : int
Return values
int —getRange()
Get the page range
public
getRange() : int
Return values
int —getSeparator()
Get the bookend separator
public
getSeparator() : string
Return values
string —getTotal()
Get the content items total
public
getTotal() : int
Return values
int —setBookends()
Set the bookends
public
setBookends(array<string|int, mixed> $bookends) : AbstractPaginator
Parameters
- $bookends : array<string|int, mixed>
Return values
AbstractPaginator —setClassOff()
Set the class 'off' name.
public
setClassOff(string $class) : Range
Parameters
- $class : string
Return values
Range —setClassOn()
Set the class 'on' name
public
setClassOn(string $class) : Range
Parameters
- $class : string
Return values
Range —setQueryKey()
Set the query key
public
setQueryKey(string $key) : AbstractPaginator
Parameters
- $key : string
Return values
AbstractPaginator —setSeparator()
Set the bookend separator
public
setSeparator(string $sep) : Range
Parameters
- $sep : string
Return values
Range —wrapLinks()
Wrap page links in an HTML node
public
wrapLinks(string $node[, string $classOn = null ][, string $classOff = null ]) : array<string|int, mixed>
Parameters
- $node : string
- $classOn : string = null
- $classOff : string = null