980. Class

980.1. Zend\View\Helper\ServerUrl

Helper for returning the current server URL (optionally with request URI)

980.1.1. Methods

980.1.1.1. __invoke

__invoke()

View helper entry point: Returns the current host’s URL like http://site.com

Parameters:string|bool – [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.
Return type:string server url

980.1.1.2. getHost

getHost()

Returns host

Return type:string host

980.1.1.3. setHost

setHost()

Sets host

Parameters:string – new host
Return type:ZendViewHelperServerUrl fluent interface, returns self

980.1.1.4. getScheme

getScheme()

Returns scheme (typically http or https)

Return type:string scheme (typically http or https)

980.1.1.5. setScheme

setScheme()

Sets scheme (typically http or https)

Parameters:string – new scheme (typically http or https)
Return type:ZendViewHelperServerUrl fluent interface, returns self

980.1.1.6. getPort

getPort()

Retrieve the server port

Return type:int|null

980.1.1.7. setPort

setPort()

Set server port

Parameters:int
Return type:ServerUrl

980.1.1.8. setUseProxy

setUseProxy()

Set flag indicating whether or not to query proxy servers

Parameters:bool
Return type:ServerUrl

980.1.1.9. detectHost

detectHost()

Detect the host based on headers

Return type:void

980.1.1.10. setHostFromProxy

setHostFromProxy()

Detect if a proxy is in use, and, if so, set the host based on it

Return type:bool

980.1.1.11. detectScheme

detectScheme()

Detect the scheme

Return type:null

980.1.1.12. detectPort

detectPort()

Detect the port

Return type:null

980.1.1.13. setSchemeFromProxy

setSchemeFromProxy()

Set the current scheme based on detected proxy headers

Return type:bool

980.1.1.14. setPortFromProxy

setPortFromProxy()

Set port based on detected proxy headers

Return type:bool