Url
class Url implements JsonSerializable
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 part of domain.
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
No description
Similar to rawurldecode, but preserves reserved chars encoded.
Parses query string.
Details
at line 90
__construct($url = null)
No description
at line 120
Url
setScheme($value)
Sets the scheme part of URI.
at line 131
string
getScheme()
Returns the scheme part of URI.
at line 142
Url
setUser($value)
Sets the user name part of URI.
at line 153
string
getUser()
Returns the user name part of URI.
at line 164
Url
setPassword($value)
Sets the password part of URI.
at line 175
string
getPassword()
Returns the password part of URI.
at line 186
Url
setHost($value)
Sets the host part of URI.
at line 198
string
getHost()
Returns the host part of URI.
at line 208
string
getDomain($level = 2)
Returns the part of domain.
at line 221
Url
setPort($value)
Sets the port part of URI.
at line 232
int|null
getPort()
Returns the port part of URI.
at line 243
Url
setPath($value)
Sets the path part of URI.
at line 257
string
getPath()
Returns the path part of URI.
at line 268
Url
setQuery($value)
Sets the query part of URI.
at line 280
Url
appendQuery($value)
Appends the query part of URI.
at line 293
string
getQuery()
Returns the query part of URI.
at line 302
array
getQueryParameters()
No description
at line 313
mixed
getQueryParameter($name, $default = null)
No description
at line 324
Url
setQueryParameter($name, $value)
No description
at line 336
Url
setFragment($value)
Sets the fragment part of URI.
at line 347
string
getFragment()
Returns the fragment part of URI.
at line 357
string
getAbsoluteUrl()
Returns the entire URI including query string and fragment.
at line 369
string
getAuthority()
Returns the [user[:pass]@]host[:port] part of URI.
at line 387
string
getHostUrl()
Returns the scheme and authority part of URI.
at line 398
string
getBasePath()
Returns the base-path.
at line 409
string
getBaseUrl()
Returns the base-URI.
at line 419
string
getRelativeUrl()
Returns the relative-URI.
at line 430
bool
isEqual($url)
URL comparison.
at line 453
Url
canonicalize()
Transforms URL to canonical form.
at line 468
string
__toString()
No description
at line 477
string
jsonSerialize()
No description
at line 489
static string
unescape($s, $reserved = '%;/?:@&=+$,')
Similar to rawurldecode, but preserves reserved chars encoded.
at line 509
static array
parseQuery($s)
Parses query string.