Static Public Member Functions |
| static | getInstance () |
| static | url () |
| static | protocol () |
| static | server () |
| static | path () |
| static | set ($param, $value) |
| static | get ($param, $default=NULL) |
| static | quoted ($param, $default=NULL) |
| static | option ($param, $default=NULL) |
| static | int ($param, $default=NULL) |
| static | float ($param, $default=NULL) |
| static | username ($param, $default=NULL) |
| static | getArray ($param) |
| static | quotedArray ($param) |
| static | optionArray ($param) |
| static | intArray ($param) |
| static | floatArray ($param) |
| static | usernameArray ($param) |
| static | submitted ($param) |
| static | submittedSome ($param) |
| static | addslashes ($value) |
| static | removeMagicQuotes ($value) |
| static | method () |
| static | isGet () |
| static | isPost () |
| static | isPut () |
| static | isDelete () |
| static | isXhr () |
| static | isAjax () |
| static | extract ($what) |
| static | getObject ($param, $expected_class=null, $allow_null=true) |
| static | getManyObjects ($param, $expected_class=null, $allow_null=true) |
Detailed Description
Singleton class representing a HTTP request in Stud.IP.
Member Function Documentation
| 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
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
| 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
| 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
| 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
| 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
Return the Request singleton instance.
| static getManyObjects |
( |
|
$param, |
|
|
|
$expected_class = null, |
|
|
|
$allow_null = true |
|
) |
| |
|
static |
Returns a collection of objects that have previously been serialized using the ObjectBuilder.
- Parameters
-
| String | $param | parameter name |
| mixed | $expected_class | Expected class name of objects (optional) |
| bool | $allow_null | If true, return empty array on error; otherwise an exception is thrown |
- Returns
- array as collection of objects
- Exceptions
-
| Exception | when an error occurs and $allow_null = false |
- See Also
- ObjectBuilder
| static getObject |
( |
|
$param, |
|
|
|
$expected_class = null, |
|
|
|
$allow_null = true |
|
) |
| |
|
static |
Returns an object that has previously been serialized using the ObjectBuilder.
- Parameters
-
| String | $param | parameter name |
| mixed | $expected_class | Expected class name of object (optional) |
| bool | $allow_null | If true, return null on error; otherwise an exception is thrown |
- Returns
- mixed Object of arbitrary type or null on error and $allow_null
- Exceptions
-
| Exception | when an error occurs and $allow_null = false |
- See Also
- ObjectBuilder
| 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
| 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
This is an alias of Request::isXhr
- Returns
- boolean true if this an XmlHttpRequest sent by jQuery/prototype
- Returns
- boolean true if this a DELETE request
- Returns
- boolean true if this a GET request
- Returns
- boolean true if this a POST request
- Returns
- boolean true if this a PUT request
- Returns
- boolean true if this an XmlHttpRequest sent by jQuery/prototype
Returns the (uppercase) request method.
- Returns
- string the uppercased method of the request
| offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
| 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
| 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
Return the current request path, relative to the server root.
Return the current protocol ('http' or 'https').
| 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
| 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
| 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
Return the current server name and port (host:port).
| 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) |
| 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
| 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
Return the current URL, including query parameters.
| 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
| 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: