JPagination
Extends \JObjectPagination Class. Provides a common interface for content pagination for the Joomla! Platform.
This class allows for simple but smart objects with get and set methods and an internal error handler.
package |
Joomla.Platform |
---|---|
subpackage |
HTML |
since |
11.1 |
Methods
__construct
Class constructor, overridden in descendant classes.
__construct(mixed $properties = null)
since |
11.1 |
---|
Arguments
- $properties
mixed
Either and associative array or another object to set the initial properties of the object.
__toString
Magic method to convert the object to a string gracefully.
__toString() : string
since |
11.1 |
---|---|
deprecated |
12.3 Classes should provide their own __toString() implementation. |
Response
string
The classname.
_buildDataObject
Create and return the pagination data object.
_buildDataObject() : object
since |
11.1 |
---|
Response
object
Pagination data object.
_item_active
Method to create an active pagination link to the item
_item_active( &$item) : string
since |
11.1 |
---|
Arguments
- $item
Response
string
HTML link
_item_inactive
Method to create an inactive pagination string
_item_inactive( &$item) : string
since |
11.1 |
---|
Arguments
- $item
Response
string
_list_render
Create the html for a list footer
_list_render(array $list) : string
since |
11.1 |
---|
Arguments
- $list
array
Pagination list data structure.
Response
string
HTML for a list start, previous, next,end
def
Sets a default value if not alreay assigned
def(string $property, mixed $default = null) : mixed
since |
11.1 |
---|
Arguments
- $property
string
The name of the property.- $default
mixed
The default value.
Response
mixed
get
Returns a property of the object or the default value if the property is not set.
get(string $property, mixed $default = null) : mixed
since |
11.1 |
---|---|
see | \JObject::getProperties() |
Arguments
- $property
string
The name of the property.- $default
mixed
The default value.
Response
mixed
The 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 |
11.1 |
---|
Arguments
- $key
string
The name of the URL parameter for which to get the value.
Response
mixed
The 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() : object
since |
11.1 |
---|
Response
object
Pagination data object.
getError
Get the most recent error message.
getError(integer $i = null, boolean $toString = true) : string
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Arguments
- $i
integer
Option error index.- $toString
boolean
Indicates if JError objects should return their error message.
Response
string
Error message
getErrors
Return all errors, if any.
getErrors() : array
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Response
array
Array of error messages or JErrors.
getLimitBox
Creates a dropdown box for selecting how many records to show per page.
getLimitBox() : string
since |
11.1 |
---|
Response
string
The HTML for the limit # input box.
getPagesCounter
Create and return the pagination pages counter string, ie. Page 2 of 4.
getPagesCounter() : string
since |
11.1 |
---|
Response
string
Pagination pages counter string.
getPagesLinks
Create and return the pagination page list string, ie. Previous, Next, 1 2 3 .
getPagesLinks() : string
.. x.
since |
11.1 |
---|
Response
string
Pagination page list string.
getProperties
Returns an associative array of object properties.
getProperties(boolean $public = true) : array
since |
11.1 |
---|---|
see | \JObject::get() |
Arguments
- $public
boolean
If true, returns only the public properties.
Response
array
getResultsCounter
Create and return the pagination result set counter string, e.g. Results 1-10 of 42
getResultsCounter() : string
since |
11.1 |
---|
Response
string
Pagination result set counter string.
getRowOffset
Return the rationalised offset for a row with a given index.
getRowOffset(integer $index) : integer
since |
11.1 |
---|
Arguments
- $index
integer
The row index
Response
integer
Rationalised 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 |
11.1 |
---|
Arguments
- $i
integer
The row index.- $n
integer
The number of items in the list.- $condition
boolean
True to show the icon.- $task
string
The task to fire.- $alt
string
The image alternative text string.- $enabled
boolean
An optional setting for access control on the action.- $checkbox
string
An optional prefix for checkboxes.
Response
string
Either 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 |
11.1 |
---|
Arguments
- $i
integer
The row index.- $condition
boolean
True to show the icon.- $task
string
The task to fire.- $alt
string
The image alternative text string.- $enabled
boolean
An optional setting for access control on the action.- $checkbox
string
An optional prefix for checkboxes.
Response
string
Either 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) : mixed
since |
11.1 |
---|
Arguments
- $property
string
The name of the property.- $value
mixed
The value of the property to set.
Response
mixed
Previous value of the property.
setAdditionalUrlParam
Method to set an additional URL parameter to be added to all pagination class generated links.
setAdditionalUrlParam(string $key, mixed $value) : mixed
since |
11.1 |
---|
Arguments
- $key
string
The name of the URL parameter for which to set a value.- $value
mixed
The value to set for the URL parameter.
Response
mixed
The old value for the parameter.
setError
Add an error message.
setError(string $error) : void
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Arguments
- $error
string
Error message.
setProperties
Set the object properties based on a named array/hash.
setProperties(mixed $properties) : boolean
since |
11.1 |
---|---|
see | \JObject::set() |
Arguments
- $properties
mixed
Either an associative array or another object.
Response
boolean
toString
Converts the object to a string (the class name).
toString() : string
Properties
limitstart
The record number to start displaying from.
since |
11.1 |
---|
Type(s)
integer
limit
Number of rows to display per page.
since |
11.1 |
---|
Type(s)
integer
total
Total number of rows.
since |
11.1 |
---|
Type(s)
integer
prefix
Prefix used for request variables.
since |
11.1 |
---|
Type(s)
integer
_viewall
View all flag
since |
11.1 |
---|
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 |
11.1 |
---|
Type(s)
array
_errors
An array of error messages or Exception objects.