Request (Api)

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

Method Description Returns
getLocale() 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. string
getLanguage() Get the language for the request as two-char string, for example "en". Might have been influenced by a user- or session-specific locale. string
getHostname() Get the http hostname string
getScheme() Get the scheme excluding colon or double slash string
getSchemeAndHost() Get the scheme and http host string
getMethod() Get the method used in the request as upperscore string string
getCookies() Get the cookies from the request array
getCookie(string $key, $default) Get a cookie with the specified key. Returns the default value if the cookie does not exist. string
getPath() Get the path for the Request with url entities decoded, e.g. /de%20homepage?abc=def => /de homepage string
getQueryString() Get query string of the request; for "/search/tours?fields.tourType=past" the "fields.tourType=past" is returned string
getParameters() Get the query parameters from the request array
getParameter(string $key) Get a query parameter with the specified key. Returns null if the parameter does not exist. string
isPdfRequest() Check if a request is a PDF request bool