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 | ||
string | $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 |
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
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.
Details
at line 89
__construct($url = NULL)
No description
at line 122
Url
setScheme($value)
Sets the scheme part of URI.
at line 133
string
getScheme()
Returns the scheme part of URI.
at line 144
Url
setUser($value)
Sets the user name part of URI.
at line 155
string
getUser()
Returns the user name part of URI.
at line 166
Url
setPassword($value)
Sets the password part of URI.
at line 177
string
getPassword()
Returns the password part of URI.
at line 188
Url
setHost($value)
Sets the host part of URI.
at line 199
string
getHost()
Returns the host part of URI.
at line 210
Url
setPort($value)
Sets the port part of URI.
at line 221
string
getPort()
Returns the port part of URI.
at line 232
Url
setPath($value)
Sets the path part of URI.
at line 243
string
getPath()
Returns the path part of URI.
at line 254
Url
setQuery($value)
Sets the query part of URI.
at line 266
Url
appendQuery($value)
Appends the query part of URI.
at line 278
string
getQuery()
Returns the query part of URI.
at line 289
mixed
getQueryParameter($name, $default = NULL)
No description
at line 301
Url
setQueryParameter($name, $value)
No description
at line 319
Url
setFragment($value)
Sets the fragment part of URI.
at line 330
string
getFragment()
Returns the fragment part of URI.
at line 340
string
getAbsoluteUrl()
Returns the entire URI including query string and fragment.
at line 352
string
getAuthority()
Returns the [user[:pass]@]host[:port] part of URI.
at line 371
string
getHostUrl()
Returns the scheme and authority part of URI.
at line 381
string
getBasePath()
Returns the base-path.
at line 392
string
getBaseUrl()
Returns the base-URI.
at line 402
string
getRelativeUrl()
Returns the relative-URI.
at line 413
bool
isEqual($url)
URL comparison.
at line 436
Url
canonicalize()
Transforms URL to canonical form.
at line 448
string
__toString()
No description
at line 460
static string
unescape($s, $reserved = '%;/?:@&=+$,')
Similar to rawurldecode, but preserves reserved chars encoded.