JURI/parse
From Joomla! Documentation
< API15:JURI
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Parse a given URI and populate the class fields
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
parse($uri)
Parameter Name | Default Value | Description |
---|---|---|
$uri | $uri The URI string to parse |
Returns[edit]
boolean True on success
Defined in[edit]
libraries/joomla/environment/uri.php
Importing[edit]
jimport( 'joomla.environment.uri' );
Source Body[edit]
function parse($uri)
{
//Initialize variables
$retval = false;
// Set the original URI to fall back on
$this->_uri = $uri;
/*
* Parse the URI and populate the object fields. If URI is parsed properly,
* set method return value to true.
*/
if ($_parts = $this->_parseURL($uri)) {
$retval = true;
}
//We need to replace & with & for parse_str to work right...
if(isset ($_parts['query']) && strpos($_parts['query'], '&')) {
$_parts['query'] = str_replace('&', '&', $_parts['query']);
}
$this->_scheme = isset ($_parts['scheme']) ? $_parts['scheme'] : null;
$this->_user = isset ($_parts['user']) ? $_parts['user'] : null;
$this->_pass = isset ($_parts['pass']) ? $_parts['pass'] : null;
$this->_host = isset ($_parts['host']) ? $_parts['host'] : null;
$this->_port = isset ($_parts['port']) ? $_parts['port'] : null;
$this->_path = isset ($_parts['path']) ? $_parts['path'] : null;
$this->_query = isset ($_parts['query'])? $_parts['query'] : null;
$this->_fragment = isset ($_parts['fragment']) ? $_parts['fragment'] : null;
//parse the query
if(isset ($_parts['query'])) parse_str($_parts['query'], $this->_vars);
return $retval;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]