\CodeIgniter\PagerPagerRenderer

Class PagerRenderer

This class is passed to the view that describes the pagination, and is used to get the link information and provide utility methods needed to work with pagination.

Summary

Methods
Properties
Constants
__construct()
setSurroundCount()
hasPrevious()
getPrevious()
hasNext()
getNext()
getFirst()
getLast()
getCurrent()
links()
No public properties found
No constants found
updatePages()
$first
$last
$current
$total
$pageCount
$uri
$segment
N/A
No private methods found
No private properties found
N/A

Properties

$first

$first : integer

First page number.

Type

integer

$last

$last : integer

Last page number.

Type

integer

$current

$current : integer

Current page number.

Type

integer

$total

$total : integer

Total number of pages? unused?

Type

integer

$pageCount

$pageCount : integer

Page count?

Type

integer

$uri

$uri : integer

URI base for pagination links

Type

integer

$segment

$segment : integer

Segment number used for pagination.

Type

integer

Methods

__construct()

__construct(array  $details) 

Constructor.

Parameters

array $details

setSurroundCount()

setSurroundCount(integer|null  $count = null) : \CodeIgniter\Pager\PagerRenderer

Sets the total number of links that should appear on either side of the current page. Adjusts the first and last counts to reflect it.

Parameters

integer|null $count

Returns

\CodeIgniter\Pager\PagerRenderer

hasPrevious()

hasPrevious() : boolean

Checks to see if there is a "previous" page before our "first" page.

Returns

boolean

getPrevious()

getPrevious() : string|null

Returns a URL to the "previous" page. The previous page is NOT the page before the current page, but is the page just before the "first" page.

You MUST call hasPrevious() first, or this value may be invalid.

Returns

string|null

hasNext()

hasNext() : boolean

Checks to see if there is a "next" page after our "last" page.

Returns

boolean

getNext()

getNext() : string|null

Returns a URL to the "next" page. The next page is NOT, the page after the current page, but is the page that follows the "last" page.

You MUST call hasNext() first, or this value may be invalid.

Returns

string|null

getFirst()

getFirst() : string

Returns the URI of the first page.

Returns

string

getLast()

getLast() : string

Returns the URI of the last page.

Returns

string

getCurrent()

getCurrent() : string

Returns the URI of the current page.

Returns

string

links()

links() : array

Returns an array of links that should be displayed. Each link is represented by another array containing of the URI the link should go to, the title (number) of the link, and a boolean value representing whether this link is active or not.

Returns

array

updatePages()

updatePages(integer|null  $count = null) 

Updates the first and last pages based on $surroundCount, which is the number of links surrounding the active page to show.

Parameters

integer|null $count

The new "surroundCount"