| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Environment |
JURI |
setAnchor |
setAnchor() |
Never | Work in Progress |
Sets the URI anchor string. The URI anchor is everything after the ‘#’.
void setAnchor ( $anchor )
| $anchor | string | is a string containing the new URI anchor. |
Example
$uri = new JURI( 'http://www.joomla.org?action=help#create' ); echo "Before: " . $uri->toString(); $uri->setAnchor( 'delete' ); echo "After: " . $uri->toString();
might produce:
Result
Before: http://www.joomla.org?action=help#create After: http://www.joomla.org?action=help#delete