API16

API16:JPagination/setAdditionalUrlParam

From Joomla! Documentation

Description

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



Syntax

setAdditionalUrlParam($key, $value)
Parameter Name Default Value Description
$key $key The name of the URL parameter for which to set a value.
$value $value The value to set for the URL parameter.

Returns

mixed The old value for the parameter.

Defined in

libraries/joomla/html/pagination.php

Importing

jimport( 'joomla.html.pagination' );

Source Body

public function setAdditionalUrlParam($key, $value)
{
        // Get the old value to return and set the new one for the URL parameter.
        $result = isset($this->_additionalUrlParams[$key]) ? $this->_additionalUrlParams[$key] : null;

        // If the passed parameter value is null unset the parameter, otherwise set it to the given value.
        if ($value === null) {
                unset($this->_additionalUrlParams[$key]);
        }
        else {
                $this->_additionalUrlParams[$key] = $value;
        }

        return $result;
}



Examples

Code Examples