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 read-only $queryParameters

Methods

__construct(Url $url)

No description

withScheme(string $scheme)

No description

string
getScheme()

No description

withUser(string $user) deprecated

No description

string
getUser() deprecated

No description

withPassword(string $password) deprecated

No description

string
getPassword() deprecated

No description

withoutUserInfo() deprecated

No description

withHost(string $host)

No description

string
getHost()

No description

string
getDomain(int $level = 2)

No description

withPort(int $port)

No description

int|null
getPort()

No description

int|null
getDefaultPort()

No description

withPath(string $path)

No description

string
getPath()

No description

withQuery(string|array $query)

No description

string
getQuery()

No description

withQueryParameter(string $name, mixed $value)

No description

array
getQueryParameters()

No description

array|string|null
getQueryParameter(string $name)

No description

withFragment(string $fragment)

No description

string
getFragment()

No description

string
getAbsoluteUrl()

Returns the entire URI including query string and fragment.

string
getAuthority()

Returns the [user[:pass]@]host[:port] part of URI.

string
getHostUrl()

Returns the scheme and authority part of URI.

string
__toString()

No description

bool
isEqual(Url|self $url)

No description

resolve(string $reference)

Resolves relative URLs in the same way as browser. If path is relative, it is resolved against base URL, if begins with /, it is resolved against the host root.

string
mergePath(string $path)

No description

string
jsonSerialize()

No description

array
export()

No description

Details

at line 59
__construct(Url $url)

No description

Parameters

Url $url

Exceptions

InvalidArgumentException

at line 66
UrlImmutable withScheme(string $scheme)

No description

Parameters

string $scheme

Return Value

UrlImmutable

at line 75
string getScheme()

No description

Return Value

string

at line 82
UrlImmutable withUser(string $user) deprecated

deprecated

No description

Parameters

string $user

Return Value

UrlImmutable

at line 92
string getUser() deprecated

deprecated

No description

Return Value

string

at line 99
UrlImmutable withPassword(string $password) deprecated

deprecated

No description

Parameters

string $password

Return Value

UrlImmutable

at line 109
string getPassword() deprecated

deprecated

No description

Return Value

string

at line 116
UrlImmutable withoutUserInfo() deprecated

deprecated

No description

Return Value

UrlImmutable

at line 125
UrlImmutable withHost(string $host)

No description

Parameters

string $host

Return Value

UrlImmutable

at line 134
string getHost()

No description

Return Value

string

at line 140
string getDomain(int $level = 2)

No description

Parameters

int $level

Return Value

string

at line 152
UrlImmutable withPort(int $port)

No description

Parameters

int $port

Return Value

UrlImmutable

at line 161
int|null getPort()

No description

Return Value

int|null

at line 167
int|null getDefaultPort()

No description

Return Value

int|null

at line 173
UrlImmutable withPath(string $path)

No description

Parameters

string $path

Return Value

UrlImmutable

at line 186
string getPath()

No description

Return Value

string

at line 192
UrlImmutable withQuery(string|array $query)

No description

Parameters

string|array $query

Return Value

UrlImmutable

at line 200
string getQuery()

No description

Return Value

string

at line 206
UrlImmutable withQueryParameter(string $name, mixed $value)

No description

Parameters

string $name
mixed $value

Return Value

UrlImmutable

at line 214
array getQueryParameters()

No description

Return Value

array

at line 220
array|string|null getQueryParameter(string $name)

No description

Parameters

string $name

Return Value

array|string|null

at line 226
UrlImmutable withFragment(string $fragment)

No description

Parameters

string $fragment

Return Value

UrlImmutable

at line 234
string getFragment()

No description

Return Value

string

at line 243
string getAbsoluteUrl()

Returns the entire URI including query string and fragment.

Return Value

string

at line 254
string getAuthority()

Returns the [user[:pass]@]host[:port] part of URI.

Return Value

string

at line 271
string getHostUrl()

Returns the scheme and authority part of URI.

Return Value

string

at line 278
string __toString()

No description

Return Value

string

at line 284
bool isEqual(Url|self $url)

No description

Parameters

Url|self $url

Return Value

bool

at line 294
UrlImmutable resolve(string $reference)

Resolves relative URLs in the same way as browser. If path is relative, it is resolved against base URL, if begins with /, it is resolved against the host root.

Parameters

string $reference

Return Value

UrlImmutable

at line 325
protected string mergePath(string $path)

internal  
 

No description

Parameters

string $path

Return Value

string

at line 332
string jsonSerialize()

No description

Return Value

string

at line 339
final array export()

internal  
 

No description

Return Value

array

Traits

SmartObject