PHP Class Nette\Http\Url

scheme  user  password  host  port  basePath   relativeUrl
  |      |      |        |      |    |             |
--\   /--\ /------\ /-------\ /--\/--\/----------------------------\
http://john:[email protected]:8042/en/manual.php?name=param#fragment  <-- absoluteUrl
       \__________________________/\____________/^\________/^\______/
                    |                     |           |         |
                authority               path        query    fragment
- authority: [user[:password]@]host[:port] - hostUrl: http://user:[email protected]:8042 - basePath: /en/ (everything before relative URI not including the script name) - baseUrl: http://user:[email protected]:8042/en/ - relativeUrl: manual.php
Author: David Grudl
Inheritance: extends Nette\FreezableObject
Mostra file Open project: nette/http Class Usage Examples

Public Properties

Property Type Description
$defaultPorts array

Public Methods

Method Description
__construct ( $url = NULL )
__toString ( ) : string
appendQuery ( $value ) : self Appends the query part of URI.
canonicalize ( ) : self Transforms URL to canonical form.
getAbsoluteUrl ( ) : string Returns the entire URI including query string and fragment.
getAuthority ( ) : string Returns the [user[:pass]@]host[:port] part of URI.
getBasePath ( ) : string Returns the base-path.
getBaseUrl ( ) : string Returns the base-URI.
getFragment ( ) : string Returns the fragment part of URI.
getHost ( ) : string Returns the host part of URI.
getHostUrl ( ) : string Returns the scheme and authority part of URI.
getPassword ( ) : string Returns the password part of URI.
getPath ( ) : string Returns the path part of URI.
getPort ( ) : integer | null Returns the port part of URI.
getQuery ( ) : string Returns the query part of URI.
getQueryParameter ( $name, $default = NULL ) : mixed
getQueryParameters ( ) : array
getRelativeUrl ( ) : string Returns the relative-URI.
getScheme ( ) : string Returns the scheme part of URI.
getUser ( ) : string Returns the user name part of URI.
isEqual ( $url ) : boolean URL comparison.
jsonSerialize ( ) : string
parseQuery ( $s ) : array Parses query string.
setFragment ( $value ) : self Sets the fragment part of URI.
setHost ( $value ) : self Sets the host part of URI.
setPassword ( $value ) : self Sets the password part of URI.
setPath ( $value ) : self Sets the path part of URI.
setPort ( $value ) : self Sets the port part of URI.
setQuery ( $value ) : self Sets the query part of URI.
setQueryParameter ( $name, $value ) : self
setScheme ( $value ) : self Sets the scheme part of URI.
setUser ( $value ) : self Sets the user name part of URI.
unescape ( $s, $reserved = '%;/?:@&=+$,' ) : string Similar to rawurldecode, but preserves reserved chars encoded.

Method Details

__construct() public method

public __construct ( $url = NULL )

__toString() public method

public __toString ( ) : string
return string

appendQuery() public method

Appends the query part of URI.
public appendQuery ( $value ) : self
return self

canonicalize() public method

Transforms URL to canonical form.
public canonicalize ( ) : self
return self

getAbsoluteUrl() public method

Returns the entire URI including query string and fragment.
public getAbsoluteUrl ( ) : string
return string

getAuthority() public method

Returns the [user[:pass]@]host[:port] part of URI.
public getAuthority ( ) : string
return string

getBasePath() public method

Returns the base-path.
public getBasePath ( ) : string
return string

getBaseUrl() public method

Returns the base-URI.
public getBaseUrl ( ) : string
return string

getFragment() public method

Returns the fragment part of URI.
public getFragment ( ) : string
return string

getHost() public method

Returns the host part of URI.
public getHost ( ) : string
return string

getHostUrl() public method

Returns the scheme and authority part of URI.
public getHostUrl ( ) : string
return string

getPassword() public method

Returns the password part of URI.
public getPassword ( ) : string
return string

getPath() public method

Returns the path part of URI.
public getPath ( ) : string
return string

getPort() public method

Returns the port part of URI.
public getPort ( ) : integer | null
return integer | null

getQuery() public method

Returns the query part of URI.
public getQuery ( ) : string
return string

getQueryParameter() public method

public getQueryParameter ( $name, $default = NULL ) : mixed
return mixed

getQueryParameters() public method

public getQueryParameters ( ) : array
return array

getRelativeUrl() public method

Returns the relative-URI.
public getRelativeUrl ( ) : string
return string

getScheme() public method

Returns the scheme part of URI.
public getScheme ( ) : string
return string

getUser() public method

Returns the user name part of URI.
public getUser ( ) : string
return string

isEqual() public method

URL comparison.
public isEqual ( $url ) : boolean
return boolean

jsonSerialize() public method

public jsonSerialize ( ) : string
return string

parseQuery() public static method

Parses query string.
public static parseQuery ( $s ) : array
return array

setFragment() public method

Sets the fragment part of URI.
public setFragment ( $value ) : self
return self

setHost() public method

Sets the host part of URI.
public setHost ( $value ) : self
return self

setPassword() public method

Sets the password part of URI.
public setPassword ( $value ) : self
return self

setPath() public method

Sets the path part of URI.
public setPath ( $value ) : self
return self

setPort() public method

Sets the port part of URI.
public setPort ( $value ) : self
return self

setQuery() public method

Sets the query part of URI.
public setQuery ( $value ) : self
return self

setQueryParameter() public method

public setQueryParameter ( $name, $value ) : self
return self

setScheme() public method

Sets the scheme part of URI.
public setScheme ( $value ) : self
return self

setUser() public method

Sets the user name part of URI.
public setUser ( $value ) : self
return self

unescape() public static method

Similar to rawurldecode, but preserves reserved chars encoded.
public static unescape ( $s, $reserved = '%;/?:@&=+$,' ) : string
return string

Property Details

$defaultPorts public_oe static_oe property

public static array $defaultPorts
return array