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
int
The total number of items.- limitstart
int
The offset of the item to start at.- limit
int
The number of items to display per page.- prefix
string
The prefix used for request variables.- app
CMSApplication
The application object
Response
mixed
_buildDataObject
Create and return the pagination data object.
_buildDataObject() : \stdClass
since |
1.5 |
---|
Response
stdClass
Pagination 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
PaginationObject
The object with which to make an active link.
Response
string
HTML link
_item_inactive
Method to create an inactive pagination string
_item_inactive(\Joomla\CMS\Pagination\PaginationObject item) :
_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
string
HTML 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
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() : \stdClass
since |
1.5 |
---|
Response
stdClass
Pagination data object.
getLimitBox
Creates a dropdown box for selecting how many records to show per page.
getLimitBox() :
since |
1.5 |
---|
Response
string
The HTML for the limit # input box.
getPagesCounter
Create and return the pagination pages counter string, ie. Page 2 of 4.
getPagesCounter() :
since |
1.5 |
---|
Response
string
Pagination pages counter string.
getPagesLinks
Create and return the pagination page list string, ie. Previous, Next, 1 2 3 ... x.
getPagesLinks() :
since |
1.5 |
---|
Response
string
Pagination page list string.
getPaginationLinks
Get the pagination links
getPaginationLinks( layoutId = 'joomla.pagination.links', mixed||string|int options = []) :
since |
3.3 |
---|
Arguments
- layoutId
string
Layout to render the links- options
array<string|int, mixed>
Optional array with settings for the layout
Response
string
Pagination links.
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
string
Pagination result set counter string.
getRowOffset
Return the rationalised offset for a row with a given index.
getRowOffset( index) :
since |
1.5 |
---|
Arguments
- index
int
The row index
Response
int
Rationalised 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
int
The row index.- n
int
The number of items in the list.- condition
bool
True to show the icon.- task
string
The task to fire.- alt
string
The image alternative text string.- enabled
bool
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( i, condition = true, task = 'orderup', alt = 'JLIB_HTML_MOVE_UP', enabled = true, checkbox = 'cb') :
since |
1.5 |
---|
Arguments
- i
int
The row index.- condition
bool
True to show the icon.- task
string
The task to fire.- alt
string
The image alternative text string.- enabled
bool
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.
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
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.
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>
data
Pagination data object
since |
3.4 |
---|
Type(s)
object