JURI/setUser
From Joomla! Documentation
< JURI(Difference between revisions)
(New page: Sets the user name part of the URI represented by the JURI object. ===Syntax=== void setUser( $user ) where: {| class="wikitable" !Argument !Data type !Description !Default |- |$user |str...) |
m (→See also: re-categorisation) |
||
| Line 31: | Line 31: | ||
* [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#setUser JURI->setUser on api.joomla.org] | * [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#setUser JURI->setUser on api.joomla.org] | ||
* [[JURI/getUser|JURI->getUser]] | * [[JURI/getUser|JURI->getUser]] | ||
| − | <noinclude> | + | <noinclude>[[Category:JURI]]</noinclude> |
Latest revision as of 12:43, 9 August 2012
Sets the user name part of the URI represented by the JURI object.
[edit] Syntax
void setUser( $user )
where:
| Argument | Data type | Description | Default |
|---|---|---|---|
| $user | string | User name to be added to the URI. This will replace any existing user name. |
[edit] Example
In this example, a URI object is created and the user name is then changed.
$uri = 'http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis'; $u =& JURI::getInstance( $uri ); echo 'Before: ' . $u->toString() . "\n"; $u->setUser( 'amandapartridge' ); echo 'After : ' . $u->toString();
would output
Before: http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthat After : http://amandapartridge:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthat