Documentation

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
throws
rex_exception

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
psalm-taint-escape

($vartype is 'bool'|'boolean'|'int'|'integer'|'double'|'float'|'real' ? 'html' : null)

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
psalm-taint-escape

($vartype is 'bool'|'boolean'|'int'|'integer'|'double'|'float'|'real' ? 'html' : null)

getSessionNamespace()

Returns the session namespace for the current http request.

public static getSessionNamespace() : string
Return values
string

isHttps()

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
bool

isPJAXRequest()

Returns true if the request is a PJAX-Request.

public static isPJAXRequest() : bool
Tags
see
http://pjax.heroku.com/
Return values
bool

isXmlHttpRequest()

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
psalm-taint-escape

($vartype is 'bool'|'boolean'|'int'|'integer'|'double'|'float'|'real' ? 'html' : null)

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
psalm-taint-escape

($vartype is 'bool'|'boolean'|'int'|'integer'|'double'|'float'|'real' ? 'html' : null)

requestMethod()

Returns the HTTP method of the current request.

public static requestMethod() : string
Tags
psalm-return

lowercase-string

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
throws
rex_exception

setSession()

Sets a session variable.

public static setSession(string $varname, mixed $value) : void
Parameters
$varname : string

Variable name

$value : mixed

Value

Tags
throws
rex_exception

unsetSession()

Deletes a session variable.

public static unsetSession(string $varname) : void
Parameters
$varname : string

Variable name

Tags
throws
rex_exception

        
On this page

Search results