UrlImmutable
class UrlImmutable implements JsonSerializable
Immutable representation of a URL.
scheme user password host port path query fragment
| | | | | | | |
/--\ /--\ /------\ /-------\ /--\/------------\ /--------\ /------\
http://john:x0y17575@nette.org:8042/en/manual.php?name=param#fragment <-- absoluteUrl
\______\__________________________/
| |
hostUrl authority
Properties
| string read-only | $scheme | ||
| string read-only | $user | ||
| string read-only | $password | ||
| string read-only | $host | ||
| int read-only | $port | ||
| string read-only | $path | ||
| string read-only | $query | ||
| string read-only | $fragment | ||
| string read-only | $absoluteUrl | ||
| string read-only | $authority | ||
| string read-only | $hostUrl | ||
| array<string,mixed> read-only | $queryParameters |
Methods
No description
No description
No description
No description
No description
Returns the specified number of rightmost domain labels (e.g. level 2 of 'www.nette.org' -> 'nette.org').
No description
Returns the port number, falling back to the default port for the scheme if not explicitly set.
Returns the default port for the current scheme, or null if the scheme is not recognized.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Returns the [user[:pass]@]host[:port] part of URI.
Returns the scheme and authority part of URI.
No description
Checks whether two URLs are equal, ignoring query parameter order and trailing dots in hostnames.
Resolves a URI reference against this URL the same way a browser would.
No description
No description
No description
Details
at line 61
__construct(Url $url)
No description
at line 68
UrlImmutable
withScheme(string $scheme)
No description
at line 77
string
getScheme()
No description
at line 84
UrlImmutable
withUser(string $user)
deprecated
deprecated
No description
at line 94
string
getUser()
deprecated
deprecated
No description
at line 101
UrlImmutable
withPassword(string $password)
deprecated
deprecated
No description
at line 111
string
getPassword()
deprecated
deprecated
No description
at line 118
UrlImmutable
withoutUserInfo()
deprecated
deprecated
No description
at line 127
UrlImmutable
withHost(string $host)
No description
at line 136
string
getHost()
No description
at line 146
string
getDomain(int $level = 2)
Returns the specified number of rightmost domain labels (e.g. level 2 of 'www.nette.org' -> 'nette.org').
Negative values trim from the right instead.
at line 158
UrlImmutable
withPort(int $port)
No description
at line 170
int|null
getPort()
Returns the port number, falling back to the default port for the scheme if not explicitly set.
at line 179
int|null
getDefaultPort()
Returns the default port for the current scheme, or null if the scheme is not recognized.
at line 185
UrlImmutable
withPath(string $path)
No description
at line 198
string
getPath()
No description
at line 205
UrlImmutable
withQuery(string|array $query)
No description
at line 213
string
getQuery()
No description
at line 219
UrlImmutable
withQueryParameter(string $name, mixed $value)
No description
at line 228
array
getQueryParameters()
No description
at line 235
array|string|null
getQueryParameter(string $name)
No description
at line 241
UrlImmutable
withFragment(string $fragment)
No description
at line 249
string
getFragment()
No description
at line 255
string
getAbsoluteUrl()
No description
at line 266
string
getAuthority()
Returns the [user[:pass]@]host[:port] part of URI.
at line 283
string
getHostUrl()
Returns the scheme and authority part of URI.
at line 290
string
__toString()
No description
at line 299
bool
isEqual(Url|self $url)
Checks whether two URLs are equal, ignoring query parameter order and trailing dots in hostnames.
at line 309
UrlImmutable
resolve(string $reference)
Resolves a URI reference against this URL the same way a browser would.
Relative paths are resolved against the current path; paths starting with / are resolved against the host root.
at line 340
protected string
mergePath(string $path)
| internal |
No description
at line 347
string
jsonSerialize()
No description
at line 357
final array
export()
| internal |
No description