Class Uri (namespace Nette\Web)


URI Syntax (RFC 3986).

 http://user:password@nettephp.com:8042/en/manual.html?name=param#fragment
 \__/^^^\_____________________________/\_____________/^\________/^\______/
   |                    |                     |            |         |
 scheme             authority               path         query    fragment

  • authority: [user[:password]@]host[:port]
  • hostUri: http://user:password@nettephp.com:8042

Object
   |
   --FreezableObject
      |
      --Uri

Direct Known Sub-classes:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Web/Uri.php (line 55)
Public Method Summary
Uri
__construct ([string $uri = NULL])
void
appendQuery (string|array $value)
Appends the query part of URI.
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 fragment part of URI.
string
getHost ()
Returns the host part of URI.
string
Returns the scheme and authority part of URI.
void
getPass ()
string
Returns the password part of URI.
string
getPath ()
Returns the path part of URI.
string
getPort ()
Returns the port part of URI.
string
Returns the query part of URI.
string
Returns the scheme part of URI.
string
getUser ()
Returns the user name part of URI.
bool
isEqual (string $uri)
URI comparsion (this object must be in canonical form).
void
setFragment (string $value)
Sets the fragment part of URI.
void
setHost (string $value)
Sets the host part of URI.
void
setPass ($value)
void
setPassword (string $value)
Sets the password part of URI.
void
setPath (string $value)
Sets the path part of URI.
void
setPort (string $value)
Sets the port part of URI.
void
setQuery (string|array $value)
Sets the query part of URI.
void
setScheme (string $value)
Sets the scheme part of URI.
void
setUser (string $value)
Sets the user name part of URI.
static string
unescape (string $s, [string $reserved = '%;/?:@&=+$,'])
Similar to rawurldecode, but preserve reserved chars encoded.
string
Methods Inherited From FreezableObject
freeze(), isFrozen(), updating(), __clone()
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 58


Method Details

line 96

__construct

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

Input
string $uri URL
Output
Uri  
Throws
throws InvalidArgumentException

line 304

appendQuery

public void appendQuery (string|array $value)

Appends the query part of URI.

Input
string|array $value
Output
void  

line 427

canonicalize

public void canonicalize ()

Transform to canonical form.

Output
void  

line 352

getAbsoluteUri

public string getAbsoluteUri ()

Returns the entire URI including query string and fragment.

Output
string  

line 365

getAuthority

public string getAuthority ()

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

Output
string  

line 341

getFragment

public string getFragment ()

Returns the fragment part of URI.

Output
string  

line 230

getHost

public string getHost ()

Returns the host part of URI.

Output
string  

line 385

getHostUri

public string getHostUri ()

Returns the scheme and authority part of URI.

Output
string  

line 206

getPass

public void getPass ()

Output
void  
Tags
Deprecated

line 186

getPassword

public string getPassword ()

Returns the password part of URI.

Output
string  

line 278

getPath

public string getPath ()

Returns the path part of URI.

Output
string  

line 254

getPort

public string getPort ()

Returns the port part of URI.

Output
string  

line 317

getQuery

public string getQuery ()

Returns the query part of URI.

Output
string  

line 138

getScheme

public string getScheme ()

Returns the scheme part of URI.

Output
string  

line 162

getUser

public string getUser ()

Returns the user name part of URI.

Output
string  

line 397

isEqual

public bool isEqual (string $uri)

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

Input
string $uri
Output
bool  

line 329

setFragment

public void setFragment (string $value)

Sets the fragment part of URI.

Input
string $value
Output
void  

line 218

setHost

public void setHost (string $value)

Sets the host part of URI.

Input
string $value
Output
void  

line 196

setPass

public void setPass ($value)

Input
$value
Output
void  
Tags
Deprecated

line 174

setPassword

public void setPassword (string $value)

Sets the password part of URI.

Input
string $value
Output
void  

line 266

setPath

public void setPath (string $value)

Sets the path part of URI.

Input
string $value
Output
void  

line 242

setPort

public void setPort (string $value)

Sets the port part of URI.

Input
string $value
Output
void  

line 290

setQuery

public void setQuery (string|array $value)

Sets the query part of URI.

Input
string|array $value
Output
void  

line 126

setScheme

public void setScheme (string $value)

Sets the scheme part of URI.

Input
string $value
Output
void  

line 150

setUser

public void setUser (string $value)

Sets the user name part of URI.

Input
string $value
Output
void  

line 459

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 446

__toString

public string __toString ()

Output
string