Pagination

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

since

1.5

Methods

__construct

Constructor.

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

1.5

Arguments

$total

integerThe total number of items.

$limitstart

integerThe offset of the item to start at.

$limit

integerThe number of items to display per page.

$prefix

stringThe prefix used for request variables.

$app

\Joomla\CMS\Application\CMSApplicationThe application object

_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

note

As of 4.0 this method will proxy to \JLayoutHelper::render('joomla.pagination.link', ['data' => $item, 'active' => true])

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

note

As of 4.0 this method will proxy to \JLayoutHelper::render('joomla.pagination.link', ['data' => $item, 'active' => false])

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

get

Returns a property of the object or the default value if the property is not set.

get(string $property, mixed $default = null) : mixed
deprecated
since

3.0

deprecated

4.0 Access the properties directly.

Arguments

$property

stringThe name of the property.

$default

mixedThe default value.

Response

mixedThe value of the property.

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 .

getPaginationPages() : array

.. x.

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(integer $index) : integer
since

1.5

Arguments

$index

integerThe row index

Response

integerRationalised offset for a row with a given index.

orderDownIcon

Return the icon to move an item DOWN.

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

1.5

Arguments

$i

integerThe row index.

$n

integerThe number of items in the list.

$condition

booleanTrue to show the icon.

$task

stringThe task to fire.

$alt

stringThe image alternative text string.

$enabled

booleanAn 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(integer $i, boolean $condition = true, string $task = 'orderup', string $alt = 'JLIB_HTML_MOVE_UP', boolean $enabled = true, string $checkbox = 'cb') : string
since

1.5

Arguments

$i

integerThe row index.

$condition

booleanTrue to show the icon.

$task

stringThe task to fire.

$alt

stringThe image alternative text string.

$enabled

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

set

Modifies a property of the object, creating it if it does not already exist.

set(string $property, mixed $value = null) : void
deprecated
since

3.0

deprecated

4.0 Access the properties directly.

Arguments

$property

stringThe name of the property.

$value

mixedThe value of the property to set.

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)

integer

limit

Number of rows to display per page.

since

1.5

Type(s)

integer

total

Total number of rows.

since

1.5

Type(s)

integer

prefix

Prefix used for request variables.

since

1.6

Type(s)

integer

pagesStart

Value pagination object begins at

since

3.0

Type(s)

integer

pagesStop

Value pagination object ends at

since

3.0

Type(s)

integer

pagesCurrent

Current page

since

3.0

Type(s)

integer

pagesTotal

Total number of pages

since

3.0

Type(s)

integer

hideEmptyLimitstart

The flag indicates whether to add limitstart=0 to URL

since

3.9.0

Type(s)

boolean

viewall

View all flag

since

3.0

Type(s)

boolean

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

data

Pagination data object

since

3.4

Type(s)

object