Paging
in package
Creates the paging
Tags
Table of Contents
Methods
- get() : string
- Returs a string representing the complete paging HTML code for the current page
- getParametername() : mixed
- getPosition() : int
- Returns the current offset
- reset() : mixed
- Resets the paging offset to zero
- generateParameterName() : mixed
- sanitizeParameterName() : string
- Ensure that the used parameter name complies with the session restrictions defined for variable keys, as the parameter name is being used as a sesison-variable-key.
Methods
get()
Returs a string representing the complete paging HTML code for the current page
public
static get(string $uri_parameter, string $paging_text, int $numof_rows[, int $results_per_page = 0 ][, bool $showeverytime = false ][, int $position = null ][, string $parameter_name = null ][, bool $addCsrfToken = true ]) : string
Parameters
- $uri_parameter : string
-
Optional additional URI parameters, MUST start with an URI encoded ampersand (&).
- $paging_text : string
-
The text to be put in front of the paging
- $numof_rows : int
-
The number of rows available
- $results_per_page : int = 0
-
The optional maximum number of rows to be shown on a single page. Defaults to the corePagingLimit setting.
- $showeverytime : bool = false
-
If true, the paging is shown even if $numof_rows is less than $results_per_page
- $position : int = null
-
The optional starting position offset. Defaults to null
- $parameter_name : string = null
-
The optional name for the URI parameter. Will be determined automatically if empty.
- $addCsrfToken : bool = true
-
Set to
false
(defaults totrue
) to not inject a CSRF token into the paging URLs. This might be useful when the paging will be used over AJAX where CSRF is not required.
Tags
Return values
string —HTML code for the paging
getParametername()
public
static getParametername([mixed $parameterName = null ]) : mixed
Parameters
- $parameterName : mixed = null
getPosition()
Returns the current offset
public
static getPosition([string $parameter_name = null ]) : int
If the parameter 'pos' is present in the request, it overrides the value stored in the session, if any. Defaults to zero.
Parameters
- $parameter_name : string = null
-
The optional name of the position offset parameter
Return values
int —The position offset
reset()
Resets the paging offset to zero
public
static reset([string $parameter_name = null ]) : mixed
Call this if your query results in less records than the offset.
Parameters
- $parameter_name : string = null
-
The optional name of the position offset parameter
generateParameterName()
private
static generateParameterName() : mixed
sanitizeParameterName()
Ensure that the used parameter name complies with the session restrictions defined for variable keys, as the parameter name is being used as a sesison-variable-key.
private
static sanitizeParameterName(string $parameterName) : string
Parameters
- $parameterName : string
-
The name of the session-variable-key used to store the current paging position.
Return values
string —$parameterName The sanitized session-variable-key.