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
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 83
UrlImmutable
withUser(string $user)
No description
at line 94
string
getUser()
No description
at line 102
UrlImmutable
withPassword(string $password)
No description
at line 113
string
getPassword()
No description
at line 121
UrlImmutable
withoutUserInfo()
No description
at line 132
UrlImmutable
withHost(string $host)
No description
at line 141
string
getHost()
No description
at line 151
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 163
UrlImmutable
withPort(int $port)
No description
at line 175
int|null
getPort()
Returns the port number, falling back to the default port for the scheme if not explicitly set.
at line 184
int|null
getDefaultPort()
Returns the default port for the current scheme, or null if the scheme is not recognized.
at line 190
UrlImmutable
withPath(string $path)
No description
at line 203
string
getPath()
No description
at line 210
UrlImmutable
withQuery(string|array $query)
No description
at line 218
string
getQuery()
No description
at line 224
UrlImmutable
withQueryParameter(string $name, mixed $value)
No description
at line 233
array
getQueryParameters()
No description
at line 240
array|string|null
getQueryParameter(string $name)
No description
at line 246
UrlImmutable
withFragment(string $fragment)
No description
at line 254
string
getFragment()
No description
at line 260
string
getAbsoluteUrl()
No description
at line 271
string
getAuthority()
Returns the [user[:pass]@]host[:port] part of URI.
at line 288
string
getHostUrl()
Returns the scheme and authority part of URI.
at line 295
string
__toString()
No description
at line 304
bool
isEqual(Url|self $url)
Checks whether two URLs are equal, ignoring query parameter order and trailing dots in hostnames.
at line 314
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 345
protected string
mergePath(string $path)
| internal |
No description
at line 352
string
jsonSerialize()
No description
at line 362
final array
export()
| internal |
No description