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:

Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /Web/Uri.php (line 43)
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).
Uri
setFragment (string $value)
Sets the fragment part of URI.
Uri
setHost (string $value)
Sets the host part of URI.
void
setPass ($value)
Uri
setPassword (string $value)
Sets the password part of URI.
Uri
setPath (string $value)
Sets the path part of URI.
Uri
setPort (string $value)
Sets the port part of URI.
Uri
setQuery (string|array $value)
Sets the query part of URI.
Uri
setScheme (string $value)
Sets the scheme part of URI.
Uri
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 46


Method Details

line 84

__construct

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

Input
string $uri URL
Output
Uri  
Throws
throws InvalidArgumentException

line 300

appendQuery

public void appendQuery (string|array $value)

Appends the query part of URI.

Input
string|array $value
Output
void  

line 419

canonicalize

public void canonicalize ()

Transform to canonical form.

Output
void  

line 349

getAbsoluteUri

public string getAbsoluteUri ()

Returns the entire URI including query string and fragment.

Output
string  

line 362

getAuthority

public string getAuthority ()

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

Output
string  

line 338

getFragment

public string getFragment ()

Returns the fragment part of URI.

Output
string  

line 224

getHost

public string getHost ()

Returns the host part of URI.

Output
string  

line 382

getHostUri

public string getHostUri ()

Returns the scheme and authority part of URI.

Output
string  

line 198

getPass

public void getPass ()

Output
void  
Tags
Deprecated

line 177

getPassword

public string getPassword ()

Returns the password part of URI.

Output
string  

line 274

getPath

public string getPath ()

Returns the path part of URI.

Output
string  

line 249

getPort

public string getPort ()

Returns the port part of URI.

Output
string  

line 313

getQuery

public string getQuery ()

Returns the query part of URI.

Output
string  

line 127

getScheme

public string getScheme ()

Returns the scheme part of URI.

Output
string  

line 152

getUser

public string getUser ()

Returns the user name part of URI.

Output
string  

line 394

isEqual

public bool isEqual (string $uri)

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

Input
string $uri
Output
bool  

line 325

setFragment

public Uri setFragment (string $value)

Sets the fragment part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 211

setHost

public Uri setHost (string $value)

Sets the host part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 187

setPass

public void setPass ($value)

Input
$value
Output
void  
Tags
Deprecated

line 164

setPassword

public Uri setPassword (string $value)

Sets the password part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 261

setPath

public Uri setPath (string $value)

Sets the path part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 236

setPort

public Uri setPort (string $value)

Sets the port part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 286

setQuery

public Uri setQuery (string|array $value)

Sets the query part of URI.

Input
string|array $value
Output
Uri provides a fluent interface

line 114

setScheme

public Uri setScheme (string $value)

Sets the scheme part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 139

setUser

public Uri setUser (string $value)

Sets the user name part of URI.

Input
string $value
Output
Uri provides a fluent interface

line 445

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 432

__toString

public string __toString ()

Output
string