Pagination

Pagination Class. Provides a common interface for content pagination for the Joomla! CMS.

since

1.5

package

Joomla CMS

Methods

__construct

Constructor.

__construct( total,  limitstart,  limit,  prefix = '', \Joomla\CMS\Application\CMSApplication app = null) : 
since

1.5

Arguments

total

intThe total number of items.

limitstart

intThe offset of the item to start at.

limit

intThe number of items to display per page.

prefix

stringThe prefix used for request variables.

app

CMSApplicationThe application object

Response

mixed

_buildDataObject

Create and return the pagination data object.

_buildDataObject() : \stdClass
since

1.5

Response

stdClassPagination data object.

_item_active

Method to create an active pagination link to the item

_item_active(\Joomla\CMS\Pagination\PaginationObject item) : 
since

1.5

Arguments

item

PaginationObjectThe object with which to make an active link.

Response

stringHTML link

_item_inactive

Method to create an inactive pagination string

_item_inactive(\Joomla\CMS\Pagination\PaginationObject item) : 
since

1.5

Arguments

item

PaginationObjectThe item to be processed

Response

string

_list_render

Create the html for a list footer

_list_render(mixed||string|int list) : 
since

1.5

Arguments

list

array<string|int, mixed>Pagination list data structure.

Response

stringHTML for a list start, previous, next,end

getAdditionalUrlParam

Method to get an additional URL parameter (if it exists) to be added to all pagination class generated links.

getAdditionalUrlParam( key) : 
since

1.6

Arguments

key

stringThe name of the URL parameter for which to get the value.

Response

mixedThe value if it exists or null if it does not.

getData

Return the pagination data object, only creating it if it doesn't already exist.

getData() : \stdClass
since

1.5

Response

stdClassPagination data object.

getLimitBox

Creates a dropdown box for selecting how many records to show per page.

getLimitBox() : 
since

1.5

Response

stringThe HTML for the limit # input box.

getListFooter

Return the pagination footer.

getListFooter() : 
since

1.5

Response

stringPagination footer.

getPagesCounter

Create and return the pagination pages counter string, ie. Page 2 of 4.

getPagesCounter() : 
since

1.5

Response

stringPagination pages counter string.

getPaginationPages

Create and return the pagination pages list, ie. Previous, Next, 1 2 3 ... x.

getPaginationPages() : mixed||string|int
since

3.3

Response

array<string|int, mixed>Pagination pages list.

getResultsCounter

Create and return the pagination result set counter string, e.g. Results 1-10 of 42

getResultsCounter() : 
since

1.5

Response

stringPagination result set counter string.

getRowOffset

Return the rationalised offset for a row with a given index.

getRowOffset( index) : 
since

1.5

Arguments

index

intThe row index

Response

intRationalised offset for a row with a given index.

orderDownIcon

Return the icon to move an item DOWN.

orderDownIcon( i,  n,  condition = true,  task = 'orderdown',  alt = 'JLIB_HTML_MOVE_DOWN',  enabled = true,  checkbox = 'cb') : 
since

1.5

Arguments

i

intThe row index.

n

intThe number of items in the list.

condition

boolTrue to show the icon.

task

stringThe task to fire.

alt

stringThe image alternative text string.

enabled

boolAn optional setting for access control on the action.

checkbox

stringAn optional prefix for checkboxes.

Response

stringEither the icon to move an item down or a space.

orderUpIcon

Return the icon to move an item UP.

orderUpIcon( i,  condition = true,  task = 'orderup',  alt = 'JLIB_HTML_MOVE_UP',  enabled = true,  checkbox = 'cb') : 
since

1.5

Arguments

i

intThe row index.

condition

boolTrue to show the icon.

task

stringThe task to fire.

alt

stringThe image alternative text string.

enabled

boolAn optional setting for access control on the action.

checkbox

stringAn optional prefix for checkboxes.

Response

stringEither the icon to move an item up or a space.

setAdditionalUrlParam

Method to set an additional URL parameter to be added to all pagination class generated links.

setAdditionalUrlParam( key,  value) : 
since

1.6

Arguments

key

stringThe name of the URL parameter for which to set a value.

value

mixedThe value to set for the URL parameter.

Response

mixedThe old value for the parameter.

Properties

limitstart

The record number to start displaying from.

since

1.5

Type(s)

int

limit

Number of rows to display per page.

since

1.5

Type(s)

int

total

Total number of rows.

since

1.5

Type(s)

int

prefix

Prefix used for request variables.

since

1.6

Type(s)

int

pagesStart

Value pagination object begins at

since

3.0

Type(s)

int

pagesStop

Value pagination object ends at

since

3.0

Type(s)

int

pagesCurrent

Current page

since

3.0

Type(s)

int

pagesTotal

Total number of pages

since

3.0

Type(s)

int

hideEmptyLimitstart

The flag indicates whether to add limitstart=0 to URL

since

3.9.0

Type(s)

bool

viewall

View all flag

since

3.0

Type(s)

bool

additionalUrlParams

Additional URL parameters to be added to the pagination URLs generated by the class. These may be useful for filters and extra values when dealing with lists and GET requests.

since

3.0

Type(s)

array<string|int, mixed>

app

The application object

since

3.4

Type(s)

CMSApplication

data

Pagination data object

since

3.4

Type(s)

object