API16

JPagination/setAdditionalUrlParam

From Joomla! Documentation

< API16:JPagination

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

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



Syntax[edit]

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[edit]

mixed The old value for the parameter.

Defined in[edit]

libraries/joomla/html/pagination.php

Importing[edit]

jimport( 'joomla.html.pagination' );

Source Body[edit]

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[edit]

Code Examples[edit]