Class Uri (namespace Nette\Web)


URI Syntax (RFC 3986).

 http://user:pass@nette.org:8042/en/manual.html?name=param#fragment
 \__/^^^\_________________________/\_____________/^\________/^\______/
   |                |                     |            |         |
 scheme         authority               path         query    fragment

  • authority: [user[:pass]@]host[:port]
  • hostUri: http://user:pass@nette.org:8042

Object
   |
   --Uri

Direct Known Sub-classes:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Web/Uri.php (line 44)
Public Method Summary
Uri
__construct ([string $uri = NULL])
void
Transform to canonical form.
string
Returns the entire URI including query string and fragment.
string
Returns the [user[:pass]@]host[:port] part of URI.
string
Returns the scheme and authority part of URI.
bool
isEqual (string $uri)
URI comparsion (this object must be in canonical form).
static string
unescape (string $s, [string $reserved = '%;/?:@&=+$,'])
Similar to rawurldecode, but preserve reserved chars encoded.
string
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
static array $defaultPorts array( 'http' => 80, 'https' => 443, 'ftp' => 21, 'news' => 119,...

line 47

string $fragment ''

line 77

string $host ''

line 65

string $pass ''

line 62

string $path ''

line 71

int $port NULL

line 68

string $query ''

line 74

string $scheme ''

line 56

string $user ''

line 59


Method Details

line 85

__construct

public Uri __construct ([string $uri = NULL])

Input
string $uri URL
Output
Uri  
Throws
throws InvalidArgumentException

line 184

canonicalize

public void canonicalize ()

Transform to canonical form.

Output
void  

line 109

getAbsoluteUri

public string getAbsoluteUri ()

Returns the entire URI including query string and fragment.

Output
string  

line 122

getAuthority

public string getAuthority ()

Returns the [user[:pass]@]host[:port] part of URI.

Output
string  

line 142

getHostUri

public string getHostUri ()

Returns the scheme and authority part of URI.

Output
string  

line 154

isEqual

public bool isEqual (string $uri)

URI comparsion (this object must be in canonical form).

Input
string $uri
Output
bool  

line 215

unescape

public static string unescape (string $s, [string $reserved = '%;/?:@&=+$,'])

Similar to rawurldecode, but preserve reserved chars encoded.

Input
string $s to decode
string $reserved reserved characters
Output
string  

line 202

__toString

public string __toString ()

Output
string