Pagination

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

since

1.5

package

Application

Methods

__construct

Constructor.

__construct(int total, int limitstart, int limit, string prefix = '', \Joomla\CMS\Application\CMSApplication app = null) : mixed
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

\Joomla\CMS\Application\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) : string
since

1.5

Arguments

item

\Joomla\CMS\Pagination\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) : string
since

1.5

Arguments

item

\Joomla\CMS\Pagination\PaginationObjectThe item to be processed

Response

string

_list_render

Create the html for a list footer

_list_render(array list) : string
since

1.5

Arguments

list

arrayPagination 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(string key) : mixed
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() : string
since

1.5

Response

stringThe HTML for the limit # input box.

getListFooter

Return the pagination footer.

getListFooter() : string
since

1.5

Response

stringPagination footer.

getPagesCounter

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

getPagesCounter() : string
since

1.5

Response

stringPagination pages counter string.

getPaginationPages

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

getPaginationPages() : array
since

3.3

Response

arrayPagination pages list.

getResultsCounter

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

getResultsCounter() : string
since

1.5

Response

stringPagination result set counter string.

getRowOffset

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

getRowOffset(int index) : int
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(int i, int n, bool condition = true, string task = 'orderdown', string alt = 'JLIB_HTML_MOVE_DOWN', bool enabled = true, string checkbox = 'cb') : string
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(int i, bool condition = true, string task = 'orderup', string alt = 'JLIB_HTML_MOVE_UP', bool enabled = true, string checkbox = 'cb') : string
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(string key, mixed value) : mixed
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

app

The application object

since

3.4

Type(s)

CMSApplication

data

Pagination data object

since

3.4

Type(s)

object