Form
extends AbstractPaginator
in package
Paginator form class
Tags
Table of Contents
Properties
- $bookends : array<string|int, mixed>
- Page bookends
- $currentPage : int
- Current page property
- $end : int|null
- Current page end index property
- $form : string|null
- Page form property
- $inputSeparator : string
- Input separator
- $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
- $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
- getBookend() : string|null
- Get a bookend
- getBookends() : array<string|int, mixed>
- Get the bookends
- getCurrentPage() : int
- Get the current page
- getFormString() : string
- Get the page form string
- getInputSeparator() : string
- Get input separator
- 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
- getTotal() : int
- Get the content items total
- setBookends() : AbstractPaginator
- Set the bookends
- setInputSeparator() : Form
- Set input separator
- setQueryKey() : AbstractPaginator
- Set the query key
- createForm() : void
- Create links
Properties
$bookends
Page bookends
protected
array<string|int, mixed>
$bookends
= ['start' => '«', 'previous' => '‹', 'next' => '›', 'end' => '»']
$currentPage
Current page property
protected
int
$currentPage
= 1
$end
Current page end index property
protected
int|null
$end
= null
$form
Page form property
protected
string|null
$form
= null
$inputSeparator
Input separator
protected
string
$inputSeparator
= 'of'
$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
$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 ]) : mixed
Instantiate the paginator object
Parameters
- $total : int
- $perPage : 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>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>getCurrentPage()
Get the current page
public
getCurrentPage() : int
Return values
intgetFormString()
Get the page form string
public
getFormString([int|null $page = null ]) : string
Parameters
- $page : int|null = null
Return values
stringgetInputSeparator()
Get input separator
public
getInputSeparator() : string
Return values
stringgetNumberOfPages()
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
intgetTotal()
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
AbstractPaginatorsetInputSeparator()
Set input separator
public
setInputSeparator(string $separator) : Form
Parameters
- $separator : string
Return values
FormsetQueryKey()
Set the query key
public
setQueryKey(string $key) : AbstractPaginator
Parameters
- $key : string
Return values
AbstractPaginatorcreateForm()
Create links
protected
createForm([int $page = 1 ]) : void
Parameters
- $page : int = 1