Table of Contents

setAnchor

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

Sets the URI anchor string. The URI anchor is everything after the ‘#’.

Syntax

void setAnchor ( $anchor )

$anchor string is a string containing the new URI anchor.

Examples

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