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
Afficher le fichier Open project: nette/http Class Usage Examples

Méthodes publiques

Свойство Type Description
$defaultPorts array

Méthodes publiques

Méthode 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 méthode

public __construct ( $url = NULL )

__toString() public méthode

public __toString ( ) : string
Résultat string

appendQuery() public méthode

Appends the query part of URI.
public appendQuery ( $value ) : self
Résultat self

canonicalize() public méthode

Transforms URL to canonical form.
public canonicalize ( ) : self
Résultat self

getAbsoluteUrl() public méthode

Returns the entire URI including query string and fragment.
public getAbsoluteUrl ( ) : string
Résultat string

getAuthority() public méthode

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

getBasePath() public méthode

Returns the base-path.
public getBasePath ( ) : string
Résultat string

getBaseUrl() public méthode

Returns the base-URI.
public getBaseUrl ( ) : string
Résultat string

getFragment() public méthode

Returns the fragment part of URI.
public getFragment ( ) : string
Résultat string

getHost() public méthode

Returns the host part of URI.
public getHost ( ) : string
Résultat string

getHostUrl() public méthode

Returns the scheme and authority part of URI.
public getHostUrl ( ) : string
Résultat string

getPassword() public méthode

Returns the password part of URI.
public getPassword ( ) : string
Résultat string

getPath() public méthode

Returns the path part of URI.
public getPath ( ) : string
Résultat string

getPort() public méthode

Returns the port part of URI.
public getPort ( ) : integer | null
Résultat integer | null

getQuery() public méthode

Returns the query part of URI.
public getQuery ( ) : string
Résultat string

getQueryParameter() public méthode

public getQueryParameter ( $name, $default = NULL ) : mixed
Résultat mixed

getQueryParameters() public méthode

public getQueryParameters ( ) : array
Résultat array

getRelativeUrl() public méthode

Returns the relative-URI.
public getRelativeUrl ( ) : string
Résultat string

getScheme() public méthode

Returns the scheme part of URI.
public getScheme ( ) : string
Résultat string

getUser() public méthode

Returns the user name part of URI.
public getUser ( ) : string
Résultat string

isEqual() public méthode

URL comparison.
public isEqual ( $url ) : boolean
Résultat boolean

jsonSerialize() public méthode

public jsonSerialize ( ) : string
Résultat string

parseQuery() public static méthode

Parses query string.
public static parseQuery ( $s ) : array
Résultat array

setFragment() public méthode

Sets the fragment part of URI.
public setFragment ( $value ) : self
Résultat self

setHost() public méthode

Sets the host part of URI.
public setHost ( $value ) : self
Résultat self

setPassword() public méthode

Sets the password part of URI.
public setPassword ( $value ) : self
Résultat self

setPath() public méthode

Sets the path part of URI.
public setPath ( $value ) : self
Résultat self

setPort() public méthode

Sets the port part of URI.
public setPort ( $value ) : self
Résultat self

setQuery() public méthode

Sets the query part of URI.
public setQuery ( $value ) : self
Résultat self

setQueryParameter() public méthode

public setQueryParameter ( $name, $value ) : self
Résultat self

setScheme() public méthode

Sets the scheme part of URI.
public setScheme ( $value ) : self
Résultat self

setUser() public méthode

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

unescape() public static méthode

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

Property Details

$defaultPorts public_oe static_oe property

public static array $defaultPorts
Résultat array