Core classCoredna\Kernel\Helper\Response

Request

Helper for getting information about the request. Can be access with $_request

Coredna\Kernel\Helper\Response\Request

Properties 11

Take no arguments.

# getLocale()
string
Get the locale for the request in the form of language-COUNTRY, for example "en-US". Might have been overriden by a user- or session-specific locale.
# getLanguage()
string
Get the language for the request as two-char string, for example "en". Might have been influenced by a user- or session-specific locale.
# getHostname()
string
Get the http hostname
# getScheme()
string
Get the scheme excluding colon or double slash
# getSchemeAndHost()
string
Get the scheme and http host
# getMethod()
string
Get the method used in the request as uppercase string
# getCookies()
array
Get the cookies from the request
# getPath()
string
Get the path for the Request with url entities decoded, e.g. /de%20homepage?abc=def => /de homepage
# getQueryString()
string
Get query string of the request; for "/search/tours?fields.tourType=past" the "fields.tourType=past" is returned
# getParameters()
array
Get the query parameters from the request
# isPdfRequest()
bool
Check if a request is a PDF request

Methods 2

Take arguments. The API serialises only getters that need none.

# getCookie(string $key, ?mixed $default)
?mixed
Get a cookie with the specified key. Returns the default value if the cookie does not exist (the default itself defaults to null).
# getParameter(string $key)
?mixed
Get a query parameter with the specified key. Returns null if the parameter does not exist. The parameter is automatically registered as a cache vary parameter, so different values of it cache separately without needing a manual addCacheVaryParameter() call.