Url
class Url implements JsonSerializable
Mutable 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
static | $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 | ||
array read-only | $queryParameters |
Methods
No description
No description
No description
No description
No description
No description
Returns the part of domain.
No description
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
No description
No description
URL comparison.
Transforms URL to canonical form.
No description
No description
No description
Similar to rawurldecode, but preserves reserved chars encoded.
Parses query string. Is affected by directive arg_separator.input.
Determines if URL is absolute, ie if it starts with a scheme followed by colon.
Normalizes a path by handling and removing relative path references like '.', '..' and directory traversal.
Details
at line 66
__construct(UrlImmutable|null $url = null)
No description
at line 89
Url
setScheme(string $scheme)
No description
at line 96
string
getScheme()
No description
at line 102
Url
setUser(string $user)
No description
at line 111
string
getUser()
No description
at line 119
Url
setPassword(string $password)
No description
at line 128
string
getPassword()
No description
at line 136
Url
setHost(string $host)
No description
at line 144
string
getHost()
No description
at line 153
string
getDomain(int $level = 2)
Returns the part of domain.
at line 165
Url
setPort(int $port)
No description
at line 172
int|null
getPort()
No description
at line 178
int|null
getDefaultPort()
No description
at line 184
Url
setPath(string $path)
No description
at line 195
string
getPath()
No description
at line 201
Url
setQuery(string|array $query)
No description
at line 208
Url
appendQuery(string|array $query)
No description
at line 217
string
getQuery()
No description
at line 223
array
getQueryParameters()
No description
at line 229
mixed
getQueryParameter(string $name)
No description
at line 235
Url
setQueryParameter(string $name, mixed $value)
No description
at line 242
Url
setFragment(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
getBasePath()
No description
at line 299
string
getBaseUrl()
No description
at line 307
string
getRelativeUrl()
No description
at line 318
bool
isEqual(UrlImmutable $url)
URL comparison.
at line 342
Url
canonicalize()
Transforms URL to canonical form.
at line 355
string
__toString()
No description
at line 361
string
jsonSerialize()
No description
at line 368
final array
export()
internal |
No description
at line 394
static string
unescape(string $s, string $reserved = '%;/?:@&=+$,')
Similar to rawurldecode, but preserves reserved chars encoded.
at line 414
static array
parseQuery(string $s)
Parses query string. Is affected by directive arg_separator.input.
at line 427
static bool
isAbsolute(string $url)
Determines if URL is absolute, ie if it starts with a scheme followed by colon.
at line 436
static string
removeDotSegments(string $path)
Normalizes a path by handling and removing relative path references like '.', '..' and directory traversal.