Parameters

$fragment

Exceptions

Returns

Set the URI host

Note that the generic syntax for URIs allows using host names which
are not necessarily IPv4 addresses or valid DNS host names. For example,
IPv6 addresses are allowed as well, and also an abstract "registered name"
which may be any name composed of a valid set of characters, including,
for example, tilda (~) and underscore (_) which are not allowed in DNS
names.

Subclasses of Uri may impose more strict validation of host names - for
example the HTTP RFC clearly states that only IPv4 and valid DNS names
are allowed in HTTP URIs.

Parameters

$query

Returns

Set the URI scheme

If the scheme is not valid according to the generic scheme syntax or
is not acceptable by the specific URI class (e.g. 'http' or 'https' are
the only acceptable schemes for the Zend\Uri\Http class) an exception
will be thrown.

You can check if a scheme is valid before setting it using the
validateScheme() method.

Which host part types are valid for this URI?

Array of valid schemes.

Subclasses of this class that only accept specific schemes may set the
list of accepted schemes here. If not empty, when setScheme() is called
it will only accept the schemes listed here.

see

\Zend\Uri\Uri::$validSchemes

Constants

CHAR_GEN_DELIMS

CHAR_GEN_DELIMS

Inherited

inherited_from

\Zend\Uri\Uri::CHAR_GEN_DELIMS

Not in the spec - those characters have special meaning in urlencoded query parameters

CHAR_QUERY_DELIMS

Inherited

inherited_from

\Zend\Uri\Uri::CHAR_QUERY_DELIMS

CHAR_RESERVED

CHAR_RESERVED

Inherited

inherited_from

\Zend\Uri\Uri::CHAR_RESERVED

CHAR_SUB_DELIMS

CHAR_SUB_DELIMS

Inherited

inherited_from

\Zend\Uri\Uri::CHAR_SUB_DELIMS

Character classes defined in RFC-3986

CHAR_UNRESERVED

Inherited

inherited_from

\Zend\Uri\Uri::CHAR_UNRESERVED

HOST_ALL

HOST_ALL

Inherited

inherited_from

\Zend\Uri\Uri::HOST_ALL

HOST_DNS

HOST_DNS

Inherited

inherited_from

\Zend\Uri\Uri::HOST_DNS

HOST_DNS_OR_IPV4

HOST_DNS_OR_IPV4

Inherited

inherited_from

\Zend\Uri\Uri::HOST_DNS_OR_IPV4

HOST_DNS_OR_IPV4_OR_IPV6

HOST_DNS_OR_IPV4_OR_IPV6

Inherited

inherited_from

\Zend\Uri\Uri::HOST_DNS_OR_IPV4_OR_IPV6

HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME

HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME

Inherited

inherited_from

\Zend\Uri\Uri::HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME

HOST_DNS_OR_IPV6

HOST_DNS_OR_IPV6

Inherited

inherited_from

\Zend\Uri\Uri::HOST_DNS_OR_IPV6

HOST_DNS_OR_IPVANY

HOST_DNS_OR_IPVANY

Inherited

inherited_from

\Zend\Uri\Uri::HOST_DNS_OR_IPVANY

Host part types represented as binary masks
The binary mask consists of 5 bits in the following order:
<RegName> | <DNS> | <IPvFuture> | <IPv6> | <IPv4>
Place 1 or 0 in the different positions for enable or disable the part.