class Pagination

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

Properties

integer $limitstart
integer $limit
integer $total
integer $prefix
integer $pagesStart
integer $pagesStop
integer $pagesCurrent
integer $pagesTotal
boolean $hideEmptyLimitstart

Methods

__construct( integer $total, integer $limitstart, integer $limit, string $prefix = '', CMSApplication $app = null)

Constructor.

mixed
setAdditionalUrlParam( string $key, mixed $value)

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

mixed
getAdditionalUrlParam( string $key)

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

integer
getRowOffset( integer $index)

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

getData()

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

string
getPagesCounter()

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

string
getResultsCounter()

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

string
getPagesLinks()

Create and return the pagination page list string, ie. Previous, Next, 1 2 3 .

string
getPaginationLinks( string $layoutId = 'joomla.pagination.links', array $options = array())

Get the pagination links

array
getPaginationPages()

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

string
getListFooter()

Return the pagination footer.

string
getLimitBox()

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

string
orderUpIcon( integer $i, boolean $condition = true, string $task = 'orderup', string $alt = 'JLIB_HTML_MOVE_UP', boolean $enabled = true, string $checkbox = 'cb')

Return the icon to move an item UP.

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

Return the icon to move an item DOWN.

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

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

mixed
get( string $property, mixed $default = null)

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

Details

__construct( integer $total, integer $limitstart, integer $limit, string $prefix = '', CMSApplication $app = null)

Constructor.

Parameters

integer $total The total number of items.
integer $limitstart The offset of the item to start at.
integer $limit The number of items to display per page.
string $prefix The prefix used for request variables.
CMSApplication $app The application object

mixed setAdditionalUrlParam( string $key, mixed $value)

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

Parameters

string $key The name of the URL parameter for which to set a value.
mixed $value The value to set for the URL parameter.

Return Value

mixed The old value for the parameter.

mixed getAdditionalUrlParam( string $key)

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

Parameters

string $key The name of the URL parameter for which to get the value.

Return Value

mixed The value if it exists or null if it does not.

integer getRowOffset( integer $index)

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

Parameters

integer $index The row index

Return Value

integer Rationalised offset for a row with a given index.

stdClass getData()

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

Return Value

stdClass Pagination data object.

string getPagesCounter()

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

Return Value

string Pagination pages counter string.

string getResultsCounter()

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

Return Value

string Pagination result set counter string.

Create and return the pagination page list string, ie. Previous, Next, 1 2 3 .

.. x.

Return Value

string Pagination page list string.

Get the pagination links

Parameters

string $layoutId Layout to render the links
array $options Optional array with settings for the layout

Return Value

string Pagination links.

array getPaginationPages()

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

.. x.

Return Value

array Pagination pages list.

string getListFooter()

Return the pagination footer.

Return Value

string Pagination footer.

string getLimitBox()

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

Return Value

string The HTML for the limit # input box.

string orderUpIcon( integer $i, boolean $condition = true, string $task = 'orderup', string $alt = 'JLIB_HTML_MOVE_UP', boolean $enabled = true, string $checkbox = 'cb')

Return the icon to move an item UP.

Parameters

integer $i The row index.
boolean $condition True to show the icon.
string $task The task to fire.
string $alt The image alternative text string.
boolean $enabled An optional setting for access control on the action.
string $checkbox An optional prefix for checkboxes.

Return Value

string Either the icon to move an item up or a space.

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

Return the icon to move an item DOWN.

Parameters

integer $i The row index.
integer $n The number of items in the list.
boolean $condition True to show the icon.
string $task The task to fire.
string $alt The image alternative text string.
boolean $enabled An optional setting for access control on the action.
string $checkbox An optional prefix for checkboxes.

Return Value

string Either the icon to move an item down or a space.

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

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

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

void

mixed get( string $property, mixed $default = null)

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

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.