Url
final class Url (View source)
Methods
Construct the Url object
Retrieve the scheme component
Modify the scheme component
Retrieve the username component
Modify the username component
Retrieve the password component
Modify the password component
Retrieve the host component as an ASCII string
Retrieve the host component as an Unicode string
Retrieve the port component
Retrieve the path component
Retrieve the query component
Retrieve the fragment component
Modify the fragment component
Recompose the URL as an ASCII string
Recompose the URL as a Unicode string
Resolve a URL with the current object as the base URL
Serialize the Url object
Deserialize the data parameter into a Url object
Return the internal state of the URL
No description
No description
Details
static Url|null
parse(string $uri, Url|null $baseUrl = null, array $errors = null)
Parse a URL
Parses a URL.
__construct(string $uri, Url|null $baseUrl = null, array $softErrors = null)
Construct the Url object
Constructs the Uri\Rfc3986\Uri object.
string
getScheme()
Retrieve the scheme component
Retrieves the scheme component.
Url
withScheme(string $scheme)
Modify the scheme component
Creates a new URL and modifies its scheme component.
string|null
getUsername()
Retrieve the username component
Retrieves the username component.
Url
withUsername(string|null $username)
Modify the username component
Creates a new URL and modifies its username component.
string|null
getPassword()
Retrieve the password component
Retrieves the password component.
Url
withPassword(string|null $password)
Modify the password component
Creates a new URL and modifies its password component.
string|null
getAsciiHost()
Retrieve the host component as an ASCII string
Retrieves the host component as a string using punycode transcription instead of Unicode characters.
string|null
getUnicodeHost()
Retrieve the host component as an Unicode string
Retrieves the host component as a string, which may contain Unicode characters.
Url
withHost(string|null $host)
Modify the host component
Creates a new URL and modifies its host component.
int|null
getPort()
Retrieve the port component
Retrieves the port component.
Url
withPort(int|null $port)
Modify the port component
Creates a new URL and modifies its port component.
string
getPath()
Retrieve the path component
Retrieves the path component.
Url
withPath(string $path)
Modify the path component
Creates a new URL and modifies its path component.
string|null
getQuery()
Retrieve the query component
Retrieves the query component.
Url
withQuery(string|null $query)
Modify the query component
Creates a new URL and modifies its query component.
string|null
getFragment()
Retrieve the fragment component
Retrieves the fragment component.
Url
withFragment(string|null $fragment)
Modify the fragment component
Creates a new URL and modifies its fragment component.
bool
equals(Url $url, UriComparisonMode $comparisonMode = \Uri\UriComparisonMode::ExcludeFragment)
Check if two URLs are equivalent
Checks if two URLs are equivalent.
string
toAsciiString()
Recompose the URL as an ASCII string
Recomposes the URL as an ASCII string, using punycode transcription instead of Unicode characters in the host component.
string
toUnicodeString()
Recompose the URL as a Unicode string
Recomposes the URL as a string, where the host component may contain Unicode characters.
Url
resolve(string $uri, array $softErrors = null)
Resolve a URL with the current object as the base URL
Resolves a valid URL string - which may potentially be a relative-URL string - with the current object as the base URL.
array
__serialize()
Serialize the Url object
Serializes the Uri\WhatWg\Url object.
void
__unserialize(array $data)
Deserialize the data parameter into a Url object
Deserializes a data parameter into a Uri\WhatWg\Url object.
array
__debugInfo()
Return the internal state of the URL
Returns the internal state of the URL.
UrlHostType|null
getHostType()
No description
bool
isSpecialScheme()
No description