\CodeIgniter\PagerPagerInterface

Expected behavior for a Pager

Summary

Methods
Constants
links()
simpleLinks()
makeLinks()
store()
setPath()
getPageCount()
getCurrentPage()
getPageURI()
hasMore()
getFirstPage()
getLastPage()
getNextPageURI()
getPreviousPageURI()
getPerPage()
getDetails()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

links()

links(string  $group = 'default', string  $template = 'default') : string

Handles creating and displaying the

Parameters

string $group
string $template

The output template alias to render.

Returns

string

simpleLinks()

simpleLinks(string  $group = 'default', string  $template = 'default') : string

Creates simple Next/Previous links, instead of full pagination.

Parameters

string $group
string $template

Returns

string

makeLinks()

makeLinks(integer  $page, integer  $perPage, integer  $total, string  $template = 'default') : string

Allows for a simple, manual, form of pagination where all of the data is provided by the user. The URL is the current URI.

Parameters

integer $page
integer $perPage
integer $total
string $template

The output template alias to render.

Returns

string

store()

store(string  $group, integer  $page, integer  $perPage, integer  $total) : mixed

Stores a set of pagination data for later display. Most commonly used by the model to automate the process.

Parameters

string $group
integer $page
integer $perPage
integer $total

Returns

mixed

setPath()

setPath(string  $path, string  $group = 'default') : mixed

Sets the path that an aliased group of links will use.

Parameters

string $path
string $group

Returns

mixed

getPageCount()

getPageCount(string|null  $group = 'default') : integer

Returns the total number of pages.

Parameters

string|null $group

Returns

integer

getCurrentPage()

getCurrentPage(string|null  $group = 'default') : integer

Returns the number of the current page of results.

Parameters

string|null $group

Returns

integer

getPageURI()

getPageURI(integer|null  $page = null, string  $group = 'default', boolean  $returnObject = false) : string|\CodeIgniter\HTTP\URI

Returns the URI for a specific page for the specified group.

Parameters

integer|null $page
string $group
boolean $returnObject

Returns

string|\CodeIgniter\HTTP\URI

hasMore()

hasMore(string|null  $group = 'default') : boolean

Tells whether this group of results has any more pages of results.

Parameters

string|null $group

Returns

boolean

getFirstPage()

getFirstPage(string  $group = 'default') : integer

Returns the first page.

Parameters

string $group

Returns

integer

getLastPage()

getLastPage(string  $group = 'default') : integer|null

Returns the last page, if we have a total that we can calculate with.

Parameters

string $group

Returns

integer|null

getNextPageURI()

getNextPageURI(string  $group = 'default') : string|null

Returns the full URI to the next page of results, or null.

Parameters

string $group

Returns

string|null

getPreviousPageURI()

getPreviousPageURI(string  $group = 'default') : string|null

Returns the full URL to the previous page of results, or null.

Parameters

string $group

Returns

string|null

getPerPage()

getPerPage(string  $group = 'default') : integer

Returns the number of results per page that should be shown.

Parameters

string $group

Returns

integer

getDetails()

getDetails(string  $group = 'default') : array

Returns an array with details about the results, including total, per_page, current_page, last_page, next_url, prev_url, from, to.

Does not include the actual data. This data is suitable for adding a 'data' object to with the result set and converting to JSON.

Parameters

string $group

Returns

array