Url
class Url extends Object
URI Syntax (RFC 3986).
scheme user password host port basePath relativeUrl | | | | | | | /--\ /--\ /------\ /-------\ /--\/--\/----------------------------\ http://john:x0y17575@nette.org:8042/en/manual.php?name=param#fragment <-- absoluteUrl \__________________________/\____________/^\________/^\______/ | | | | authority path query fragment
- authority: [user[:password]@]host[:port]
- hostUrl: http://user:password@nette.org:8042
- basePath: /en/ (everything before relative URI not including the script name)
- baseUrl: http://user:password@nette.org:8042/en/
- relativeUrl: manual.php
Properties
static array | $defaultPorts | ||
string | $scheme | ||
string | $user | ||
string | $password | ||
string | $host | ||
int | $port | ||
string | $path | ||
string | $query | ||
string | $fragment | ||
string read-only | $absoluteUrl | ||
string read-only | $authority | ||
string read-only | $hostUrl | ||
string read-only | $basePath | ||
string read-only | $baseUrl | ||
string read-only | $relativeUrl | ||
array read-only | $queryParameters |
Methods
No description
Returns the scheme part of URI.
Returns the user name part of URI.
Sets the password part of URI.
Returns the password part of URI.
Returns the host part of URI.
Returns the port part of URI.
Returns the path part of URI.
Appends the query part of URI.
Returns the query part of URI.
No description
No description
No description
Sets the fragment part of URI.
Returns the fragment part of URI.
Returns the entire URI including query string and fragment.
Returns the [user[:pass]@]host[:port] part of URI.
Returns the scheme and authority part of URI.
Returns the base-path.
Returns the base-URI.
Returns the relative-URI.
URL comparison.
Transforms URL to canonical form.
No description
Similar to rawurldecode, but preserves reserved chars encoded.
Parses query string.
Details
at line 88
__construct($url = NULL)
No description
at line 118
Url
setScheme($value)
Sets the scheme part of URI.
at line 129
string
getScheme()
Returns the scheme part of URI.
at line 140
Url
setUser($value)
Sets the user name part of URI.
at line 151
string
getUser()
Returns the user name part of URI.
at line 162
Url
setPassword($value)
Sets the password part of URI.
at line 173
string
getPassword()
Returns the password part of URI.
at line 184
Url
setHost($value)
Sets the host part of URI.
at line 196
string
getHost()
Returns the host part of URI.
at line 207
Url
setPort($value)
Sets the port part of URI.
at line 218
int
getPort()
Returns the port part of URI.
at line 231
Url
setPath($value)
Sets the path part of URI.
at line 245
string
getPath()
Returns the path part of URI.
at line 256
Url
setQuery($value)
Sets the query part of URI.
at line 268
Url
appendQuery($value)
Appends the query part of URI.
at line 281
string
getQuery()
Returns the query part of URI.
at line 293
array
getQueryParameters()
No description
at line 304
mixed
getQueryParameter($name, $default = NULL)
No description
at line 315
Url
setQueryParameter($name, $value)
No description
at line 327
Url
setFragment($value)
Sets the fragment part of URI.
at line 338
string
getFragment()
Returns the fragment part of URI.
at line 348
string
getAbsoluteUrl()
Returns the entire URI including query string and fragment.
at line 360
string
getAuthority()
Returns the [user[:pass]@]host[:port] part of URI.
at line 378
string
getHostUrl()
Returns the scheme and authority part of URI.
at line 388
string
getBasePath()
Returns the base-path.
at line 399
string
getBaseUrl()
Returns the base-URI.
at line 409
string
getRelativeUrl()
Returns the relative-URI.
at line 420
bool
isEqual($url)
URL comparison.
at line 443
Url
canonicalize()
Transforms URL to canonical form.
at line 458
string
__toString()
No description
at line 470
static string
unescape($s, $reserved = '%;/?:@&=+$,')
Similar to rawurldecode, but preserves reserved chars encoded.
at line 490
static array
parseQuery($s)
Parses query string.