Methods
View helper entry point:
Returns the current host's URL like http://site.com
__invoke(string | bool $requestUri) : string
Parameters
$requestUri
stringbool
[optional] if true, the request URI found in $_SERVER will be appended as a path. If a string is given, it will be appended as a path. Default is to not append any path.
Returns
string
Returns host
getHost() : string
Retrieve the server port
getPort() : int | null
Returns scheme (typically http or https)
getScheme() : string
Set flag indicating whether or not to query proxy servers
setUseProxy(bool $useProxy) : \Zend\View\Helper\ServerUrl
Parameters
$useProxy
bool
Returns
Set the View object
setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited
inherited_from |
\Zend\View\Helper\AbstractHelper::setView() |
Parameters
Returns
Detect the host based on headers
detectHost() : void
Detect the port
detectPort() : null
Detect the scheme
detectScheme() : null
isReversedProxy()
isReversedProxy()
Detect if a proxy is in use, and, if so, set the host based on it
setHostFromProxy() : bool
Set port based on detected proxy headers
setPortFromProxy() : bool
Set the current scheme based on detected proxy headers
setSchemeFromProxy() : bool
Properties
Host (including port)
$host : string
Whether or not to query proxy servers for address
$useProxy : bool