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(string|UrlImmutable|Url $url)

No description

withScheme(string $scheme)

No description

string
getScheme()

No description

withUser(string $user)

No description

string
getUser()

No description

withPassword(string $password)

No description

string
getPassword()

No description

withoutUserInfo()

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

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(string|Url|UrlImmutable $url)

No description

string
jsonSerialize()

No description

array
export()

No description

void
build()

No description

Details

at line 77
__construct(string|UrlImmutable|Url $url)

No description

Parameters

string|UrlImmutable|Url $url

Exceptions

InvalidArgumentException

at line 90
UrlImmutable withScheme(string $scheme)

No description

Parameters

string $scheme

Return Value

UrlImmutable

at line 99
string getScheme()

No description

Return Value

string

at line 106
UrlImmutable withUser(string $user)

No description

Parameters

string $user

Return Value

UrlImmutable

at line 115
string getUser()

No description

Return Value

string

at line 122
UrlImmutable withPassword(string $password)

No description

Parameters

string $password

Return Value

UrlImmutable

at line 131
string getPassword()

No description

Return Value

string

at line 138
UrlImmutable withoutUserInfo()

No description

Return Value

UrlImmutable

at line 148
UrlImmutable withHost(string $host)

No description

Parameters

string $host

Return Value

UrlImmutable

at line 157
string getHost()

No description

Return Value

string

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

No description

Parameters

int $level

Return Value

string

at line 176
UrlImmutable withPort(int $port)

No description

Parameters

int $port

Return Value

UrlImmutable

at line 185
int|null getPort()

No description

Return Value

int|null

at line 192
UrlImmutable withPath(string $path)

No description

Parameters

string $path

Return Value

UrlImmutable

at line 201
string getPath()

No description

Return Value

string

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

No description

Parameters

string|array $query

Return Value

UrlImmutable

at line 220
string getQuery()

No description

Return Value

string

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

No description

Parameters

string $name
mixed $value

null unsets the parameter

Return Value

UrlImmutable

at line 238
array getQueryParameters()

No description

Return Value

array

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

No description

Parameters

string $name

Return Value

array|string|null

at line 252
UrlImmutable withFragment(string $fragment)

No description

Parameters

string $fragment

Return Value

UrlImmutable

at line 261
string getFragment()

No description

Return Value

string

at line 270
string getAbsoluteUrl()

Returns the entire URI including query string and fragment.

Return Value

string

at line 281
string getAuthority()

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

Return Value

string

at line 290
string getHostUrl()

Returns the scheme and authority part of URI.

Return Value

string

at line 297
string __toString()

No description

Return Value

string

at line 306
bool isEqual(string|Url|UrlImmutable $url)

No description

Parameters

string|Url|UrlImmutable $url

Return Value

bool

at line 312
string jsonSerialize()

No description

Return Value

string

at line 319
final array export()

internal  
 

No description

Return Value

array

at line 325
protected void build()

No description

Return Value

void

Traits

SmartObject