Support Joomla!

references:joomla.framework:environment:juri-setvar

Table of Contents

setVar

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Environment Class JURI Method setVar Reference setVar() Never Work in Progress

Adds a query variable and value, replacing the value if it already exists and returning the old value.

Syntax

string setVar ( $name, $value )

$name string is a string containing the new name of the query variable to set.
$value string is a string containing the new Value of the query variable.

Examples

Example

$uri = new JURI( 'http://forum.joomla.org/index.php/topic,41464.msg227819.html?action=new' );
echo "Old Value: " . $uri->setVar( 'action', 'delete' );
$vars = $uri->getVars();
echo "New Value: " . $vars[ 'action' ];

might produce:

Result

Old Value: new
New Value: delete
 
references/joomla.framework/environment/juri-setvar.txt (682 views) · Last modified: 2007/08/15 14:51