Table of Contents

setScheme

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

Sets the URI scheme (protocol). This function sets the URI scheme (ie. http, https, ftp, etc.).

Syntax

void setScheme ( $scheme )

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

Examples

Example

$uri = new JURI( 'http://forum.joomla.org/index.php/topic,41464.msg227819.html#msg227819' );
echo "Before: " . $uri->toString();
$uri->setScheme( 'https' );
echo "After: " . $uri->toString();

might produce:

Result

Before: http://forum.joomla.org/index.php/topic,41464.msg227819.html#msg227819
After: https://forum.joomla.org/index.php/topic,41464.msg227819.html#msg227819