Documentation

Range extends AbstractPaginator
in package

Paginator range of links class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.0.0

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' => '&laquo;', 'previous' => '&lsaquo;', 'next' => '&rsaquo;', 'end' => '&raquo;']

$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

Page links property

protected array<string|int, mixed> $links = []

$numberOfPages

Number of pages property

protected int|null $numberOfPages = null

$separator

Link separator

protected string|null $separator = null

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
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

getBookend()

Get a bookend

public getBookend(string $key) : string|null
Parameters
$key : string
Return values
string|null

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|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
int

getQueryKey()

Get the query key

public getQueryKey() : string
Return values
string

getSeparator()

Get the bookend separator

public getSeparator() : string
Return values
string

getTotal()

Get the content items total

public getTotal() : int
Return values
int

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

setSeparator()

Set the bookend separator

public setSeparator(string $sep) : Range
Parameters
$sep : string
Return values
Range

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
Return values
array<string|int, mixed>

        
On this page

Search results