Singleton class representing a HTTP request in Stud.IP.
◆ addslashes()
| static addslashes |
( |
|
$value | ) |
|
|
static |
Quote a given string or array using addslashes(). If the parameter is an array, the quoting is applied recursively.
- Parameters
-
| mixed | $value | string or array value to be quoted |
- Returns
- mixed quoted string or array
◆ extract()
extracts some params from request, the desired params must be a comma separated list for each param, the type of used extraction method can be specified after the name, default is get null values are not returned
e.g.: $data = Request::extract('admission_prelim int, admission_binding submitted, admission_prelim_txt'); will yield array(3) { ["admission_prelim"]=> int(1) ["admission_binding"]=> bool(false) ["admission_prelim_txt"]=> string(0) "" }
- Parameters
-
| string | $what | comma separated list of param names and types |
- Returns
- array assoc array with extracted data
◆ float()
| static float |
( |
|
$param, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Return the value of the selected query parameter as a float.
- Parameters
-
| string | $param | parameter name |
| float | $default | default value if parameter is not set |
- Returns
- float parameter value as float (if set), else NULL
◆ floatArray()
| static floatArray |
( |
|
$param | ) |
|
|
static |
Return the value of the selected query parameter as a float array.
- Parameters
-
| string | $param | parameter name |
- Returns
- array parameter value as array (if set), else an empty array
◆ get()
| static get |
( |
|
$param, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Return the value of the selected query parameter as a string.
- Parameters
-
| string | $param | parameter name |
| string | $default | default value if parameter is not set |
- Returns
- string parameter value as string (if set), else NULL
◆ getArray()
| static getArray |
( |
|
$param | ) |
|
|
static |
Return the value of the selected query parameter as an array.
- Parameters
-
| string | $param | parameter name |
- Returns
- array parameter value as array (if set), else an empty array
◆ getInstance()
Return the Request singleton instance.
◆ getIterator()
◆ int()
| static int |
( |
|
$param, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Return the value of the selected query parameter as an integer.
- Parameters
-
| string | $param | parameter name |
| int | $default | default value if parameter is not set |
- Returns
- int parameter value as integer (if set), else NULL
◆ intArray()
| static intArray |
( |
|
$param | ) |
|
|
static |
Return the value of the selected query parameter as an integer array.
- Parameters
-
| string | $param | parameter name |
- Returns
- array parameter value as array (if set), else an empty array
◆ isAjax()
This is an alias of Request::isXhr
- Returns
- boolean true if this an XmlHttpRequest sent by jQuery/prototype
◆ isDelete()
- Returns
- boolean true if this a DELETE request
◆ isGet()
- Returns
- boolean true if this a GET request
◆ isPost()
- Returns
- boolean true if this a POST request
◆ isPut()
- Returns
- boolean true if this a PUT request
◆ isXhr()
- Returns
- boolean true if this an XmlHttpRequest sent by jQuery/prototype
◆ method()
Returns the (uppercase) request method.
- Returns
- string the uppercased method of the request
◆ offsetExists()
◆ offsetGet()
◆ offsetSet()
| offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
◆ offsetUnset()
◆ option()
| static option |
( |
|
$param, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Return the value of the selected query parameter as an alphanumeric string (consisting of only digits, letters and underscores).
- Parameters
-
| string | $param | parameter name |
| string | $default | default value if parameter is not set |
- Returns
- string parameter value as string (if set), else NULL
◆ optionArray()
| static optionArray |
( |
|
$param | ) |
|
|
static |
Return the value of the selected query parameter as an array of alphanumeric strings (consisting of only digits, letters and underscores).
- Parameters
-
| string | $param | parameter name |
- Returns
- array parameter value as array (if set), else an empty array
◆ path()
Return the current request path, relative to the server root.
◆ protocol()
Return the current protocol ('http' or 'https').
◆ quoted()
| static quoted |
( |
|
$param, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Return the value of the selected query parameter as a string. The contents of the string is quoted with addslashes().
- Parameters
-
| string | $param | parameter name |
| string | $default | default value if parameter is not set |
- Returns
- string parameter value as string (if set), else NULL
◆ quotedArray()
| static quotedArray |
( |
|
$param | ) |
|
|
static |
Return the value of the selected query parameter as a string array. The contents of each element is quoted with addslashes().
- Parameters
-
| string | $param | parameter name |
- Returns
- array parameter value as array (if set), else an empty array
◆ removeMagicQuotes()
| static removeMagicQuotes |
( |
|
$value | ) |
|
|
static |
Strip magic quotes from a given string or array. If the PHP setting "magic_quotes_gpc" is enabled, stripslashes() is used on the value. If the parameter is an array, magic quoting is stripped recursively.
- Parameters
-
| mixed | $value | string or array value to be unquoted |
- Returns
- mixed unquoted string or array
◆ server()
Return the current server name and port (host:port).
◆ set()
| static set |
( |
|
$param, |
|
|
|
$value |
|
) |
| |
|
static |
Set the selected query parameter to a specific value.
- Parameters
-
| string | $param | parameter name |
| mixed | $value | parameter value (string or array) |
◆ submitted()
| static submitted |
( |
|
$param | ) |
|
|
static |
Check whether a form submit button has been pressed. This works for both image and text submit buttons.
- Parameters
-
| string | $param | submit button name |
- Returns
- boolean true if the button has been submitted, else false
◆ submittedSome()
| static submittedSome |
( |
|
$param | ) |
|
|
static |
Check whether one of the form submit buttons has been pressed. This works for both image and text submit buttons.
- Parameters
-
| string | ... a variable argument list of submit button names |
- Returns
- boolean true if any button has been submitted, else false
◆ url()
Return the current URL, including query parameters.
◆ username()
| static username |
( |
|
$param, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Return the value of the selected query parameter as a string consisting only of allowed characters for usernames.
- Parameters
-
| string | $param | parameter name |
| string | $default | default value if parameter is not set |
- Returns
- string parameter value (if set), else NULL
◆ usernameArray()
| static usernameArray |
( |
|
$param | ) |
|
|
static |
Return the value of the selected query parameter as an array of strings consisting only of allowed characters for usernames.
- Parameters
-
| string | $param | parameter name |
- Returns
- array parameter value as array (if set), else an empty array
The documentation for this class was generated from the following file: