rex_request
in package
Class for getting the superglobals.
Table of Contents
Methods
- clearSession() : void
- clear redaxo session contents within the current namespace (the session itself stays alive).
- cookie() : mixed
- Returns the variable $varname of $_COOKIE and casts the value.
- env() : mixed
- Returns the variable $varname of $_ENV and casts the value.
- files() : mixed
- Returns the variable $varname of $_FILES and casts the value.
- get() : mixed
- Returns the variable $varname of $_GET and casts the value.
- getSessionNamespace() : string
- Returns the session namespace for the current http request.
- isHttps() : bool
- Returns whether the current request is served via https/ssl.
- isPJAXContainer() : bool
- Returns true when the current request is a PJAX-Request and the requested container matches the given $containerId.
- isPJAXRequest() : bool
- Returns true if the request is a PJAX-Request.
- isXmlHttpRequest() : bool
- Returns true if the request is a XMLHttpRequest.
- post() : mixed
- Returns the variable $varname of $_POST and casts the value.
- request() : mixed
- Returns the variable $varname of $_REQUEST and casts the value.
- requestMethod() : string
- Returns the HTTP method of the current request.
- server() : mixed
- Returns the variable $varname of $_SERVER and casts the value.
- session() : mixed
- Returns the variable $varname of $_SESSION and casts the value.
- setSession() : void
- Sets a session variable.
- unsetSession() : void
- Deletes a session variable.
Methods
clearSession()
clear redaxo session contents within the current namespace (the session itself stays alive).
public
static clearSession() : void
Tags
cookie()
Returns the variable $varname of $_COOKIE and casts the value.
public
static cookie(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
Tags
env()
Returns the variable $varname of $_ENV and casts the value.
public
static env(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
files()
Returns the variable $varname of $_FILES and casts the value.
public
static files(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
get()
Returns the variable $varname of $_GET and casts the value.
public
static get(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
Tags
getSessionNamespace()
Returns the session namespace for the current http request.
public
static getSessionNamespace() : string
Return values
stringisHttps()
Returns whether the current request is served via https/ssl.
public
static isHttps() : bool
Return values
bool —true when https/ssl, otherwise false
isPJAXContainer()
Returns true when the current request is a PJAX-Request and the requested container matches the given $containerId.
public
static isPJAXContainer(string $containerId) : bool
Parameters
- $containerId : string
Return values
boolisPJAXRequest()
Returns true if the request is a PJAX-Request.
public
static isPJAXRequest() : bool
Tags
Return values
boolisXmlHttpRequest()
Returns true if the request is a XMLHttpRequest.
public
static isXmlHttpRequest() : bool
This only works if your javaScript library sets an X-Requested-With HTTP header. This is the case with Prototype, Mootools, jQuery, and perhaps others.
Inspired by a method of the symfony framework.
Return values
bool —true if the request is an XMLHttpRequest, false otherwise
post()
Returns the variable $varname of $_POST and casts the value.
public
static post(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
Tags
request()
Returns the variable $varname of $_REQUEST and casts the value.
public
static request(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
Tags
requestMethod()
Returns the HTTP method of the current request.
public
static requestMethod() : string
Tags
Return values
string —HTTP method in lowercase (head,get,post,put,delete)
server()
Returns the variable $varname of $_SERVER and casts the value.
public
static server(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
session()
Returns the variable $varname of $_SESSION and casts the value.
public
static session(string $varname[, mixed $vartype = '' ][, mixed $default = '' ]) : mixed
Parameters
- $varname : string
-
Variable name
- $vartype : mixed = ''
-
Variable type
- $default : mixed = ''
-
Default value
Tags
setSession()
Sets a session variable.
public
static setSession(string $varname, mixed $value) : void
Parameters
- $varname : string
-
Variable name
- $value : mixed
-
Value
Tags
unsetSession()
Deletes a session variable.
public
static unsetSession(string $varname) : void
Parameters
- $varname : string
-
Variable name