Uri
extends AbstractUri
in package
Implements PSR-7 UriInterface.
Table of Contents
Properties
- $defaultPorts : array<string|int, mixed>
- $queryParams : array<string|int, mixed>
Methods
- __construct() : void
- You can use `UriFactory` functions to create new `Uri` objects.
- __toString() : string
- getAuthority() : mixed
- getBaseUrl() : string
- Return the fully qualified base URL ( like http://getgrav.org ).
- getFragment() : mixed
- getHost() : mixed
- getParts() : array<string|int, mixed>
- getPassword() : string
- getPath() : mixed
- getPort() : mixed
- getQuery() : mixed
- getQueryParam() : string|null
- getQueryParams() : array<string|int, mixed>
- getScheme() : mixed
- getUrl() : string
- getUser() : string
- getUserInfo() : mixed
- isAbsolute() : bool
- Whether the URI is absolute, i.e. it has a scheme.
- isAbsolutePathReference() : bool
- Whether the URI is a absolute-path reference.
- isDefaultPort() : bool
- Whether the URI has the default port of the current scheme.
- isNetworkPathReference() : bool
- Whether the URI is a network-path reference.
- isRelativePathReference() : bool
- Whether the URI is a relative-path reference.
- isSameDocumentReference() : bool
- Whether the URI is a same-document reference.
- withFragment() : mixed
- withHost() : mixed
- withoutQueryParam() : UriInterface
- withPath() : mixed
- withPort() : mixed
- withQuery() : mixed
- withQueryParam() : UriInterface
- withQueryParams() : UriInterface
- withScheme() : mixed
- withUserInfo() : mixed
- initParts() : void
Properties
$defaultPorts
protected
static array<string|int, mixed>
$defaultPorts
= ['http' => 80, 'https' => 443]
$queryParams
private
array<string|int, mixed>
$queryParams
Array of Uri query.
Methods
__construct()
You can use `UriFactory` functions to create new `Uri` objects.
public
__construct([array<string|int, mixed> $parts = [] ]) : void
Parameters
- $parts : array<string|int, mixed> = []
Tags
__toString()
public
__toString() : string
Attributes
- #[ReturnTypeWillChange]
Return values
stringgetAuthority()
public
getAuthority() : mixed
Tags
getBaseUrl()
Return the fully qualified base URL ( like http://getgrav.org ).
public
getBaseUrl() : string
Return values
stringgetFragment()
public
getFragment() : mixed
Tags
getHost()
public
getHost() : mixed
Tags
getParts()
public
getParts() : array<string|int, mixed>
Return values
array<string|int, mixed>getPassword()
public
getPassword() : string
Return values
stringgetPath()
public
getPath() : mixed
Tags
getPort()
public
getPort() : mixed
Tags
getQuery()
public
getQuery() : mixed
Tags
getQueryParam()
public
getQueryParam(string $key) : string|null
Parameters
- $key : string
Return values
string|nullgetQueryParams()
public
getQueryParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getScheme()
public
getScheme() : mixed
Tags
getUrl()
public
getUrl() : string
Return values
stringgetUser()
public
getUser() : string
Return values
stringgetUserInfo()
public
getUserInfo() : mixed
Tags
isAbsolute()
Whether the URI is absolute, i.e. it has a scheme.
public
isAbsolute() : bool
An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, the base URI. Relative references can be divided into several forms:
- network-path references, e.g. '//example.com/path'
- absolute-path references, e.g. '/path'
- relative-path references, e.g. 'subpath'
Tags
Return values
boolisAbsolutePathReference()
Whether the URI is a absolute-path reference.
public
isAbsolutePathReference() : bool
A relative reference that begins with a single slash character is termed an absolute-path reference.
Tags
Return values
boolisDefaultPort()
Whether the URI has the default port of the current scheme.
public
isDefaultPort() : bool
$uri->getPort() may return the standard port. This method can be used for some non-http/https Uri.
Return values
boolisNetworkPathReference()
Whether the URI is a network-path reference.
public
isNetworkPathReference() : bool
A relative reference that begins with two slash characters is termed an network-path reference.
Tags
Return values
boolisRelativePathReference()
Whether the URI is a relative-path reference.
public
isRelativePathReference() : bool
A relative reference that does not begin with a slash character is termed a relative-path reference.
Tags
Return values
boolisSameDocumentReference()
Whether the URI is a same-document reference.
public
isSameDocumentReference([UriInterface|null $base = null ]) : bool
A same-document reference refers to a URI that is, aside from its fragment component, identical to the base URI. When no base URI is given, only an empty URI reference (apart from its fragment) is considered a same-document reference.
Parameters
- $base : UriInterface|null = null
-
An optional base URI to compare against
Tags
Return values
boolwithFragment()
public
withFragment(mixed $fragment) : mixed
Parameters
- $fragment : mixed
Tags
withHost()
public
withHost(mixed $host) : mixed
Parameters
- $host : mixed
Tags
withoutQueryParam()
public
withoutQueryParam(string $key) : UriInterface
Parameters
- $key : string
Return values
UriInterfacewithPath()
public
withPath(mixed $path) : mixed
Parameters
- $path : mixed
Tags
withPort()
public
withPort(mixed $port) : mixed
Parameters
- $port : mixed
Tags
withQuery()
public
withQuery(mixed $query) : mixed
Parameters
- $query : mixed
Tags
withQueryParam()
public
withQueryParam(string $key, string|null $value) : UriInterface
Parameters
- $key : string
- $value : string|null
Return values
UriInterfacewithQueryParams()
public
withQueryParams(array<string|int, mixed> $params) : UriInterface
Parameters
- $params : array<string|int, mixed>
Return values
UriInterfacewithScheme()
public
withScheme(mixed $scheme) : mixed
Parameters
- $scheme : mixed
Tags
withUserInfo()
public
withUserInfo(mixed $user[, mixed $password = null ]) : mixed
Parameters
- $user : mixed
- $password : mixed = null
Tags
initParts()
protected
initParts(array<string|int, mixed> $parts) : void
Parameters
- $parts : array<string|int, mixed>