|
| static | getMethod () |
| |
| static | getVar ($name, $default=null, $hash='default', $type='none', $mask=0) |
| |
| static | getInt ($name, $default=0, $hash='default') |
| |
| static | getFloat ($name, $default=0.0, $hash='default') |
| |
| static | getBool ($name, $default=false, $hash='default') |
| |
| static | getWord ($name, $default='', $hash='default') |
| |
| static | getCmd ($name, $default='', $hash='default') |
| |
| static | getString ($name, $default='', $hash='default', $mask=0) |
| |
| static | getArray ($name, $default=array(), $hash='default') |
| |
| static | getText ($name, $default='', $hash='default') |
| |
| static | getUrl ($name, $default='', $hash='default') |
| |
| static | getPath ($name, $default='', $hash='default') |
| |
| static | getEmail ($name, $default='', $hash='default') |
| |
| static | getIP ($name, $default='', $hash='default') |
| |
| static | getHeader ($headerName, $default='') |
| |
| static | hasVar ($name, $hash='default') |
| |
| static | setVar ($name, $value=null, $hash='method', $overwrite=true) |
| |
| static | get ($hash='default', $mask=0) |
| |
| static | set ($array, $hash='method', $overwrite=true) |
| |
◆ cleanVar()
| static cleanVar |
( |
|
$var, |
|
|
|
$mask = 0, |
|
|
|
$type = null |
|
) |
| |
|
staticprotected |
Clean up an input variable.
- Paramètres
-
| mixed | $var | The input variable. |
| int | $mask | Filter bit mask.
- 1=no trim: If this flag is cleared and the input is a string, the string will have leading and trailing whitespace trimmed.
- 2=allow_raw: If set, no more filtering is performed, higher bits are ignored.
- 4=allow_html: HTML is allowed, but passed through a safe HTML filter first. If set, no more filtering is performed.
- If no bits other than the 1 bit is set, a strict filter is applied.
|
| string | $type | The variable type. See FilterInput::clean(). |
- Renvoie
- string
◆ cleanVars()
| static cleanVars |
( |
|
$var, |
|
|
|
$mask = 0, |
|
|
|
$type = null |
|
) |
| |
|
staticprotected |
Clean up an array of variables.
- Paramètres
-
- Renvoie
- string
◆ get()
| static get |
( |
|
$hash = 'default', |
|
|
|
$mask = 0 |
|
) |
| |
|
static |
Fetches and returns a request array.
The default behaviour is fetching variables depending on the current request method: GET and HEAD will result in returning $_GET, POST and PUT will result in returning $_POST.
You can force the source by setting the $hash parameter:
- post $_POST
- get $_GET
- files $_FILES
- cookie $_COOKIE
- env $_ENV
- server $_SERVER
- method via current $_SERVER['REQUEST_METHOD']
- default $_REQUEST
- Paramètres
-
| string | $hash | to get (POST, GET, FILES, METHOD) |
| int | $mask | Filter mask for the variable |
- Renvoie
- mixed Request hash
◆ getArray()
| static getArray |
( |
|
$name, |
|
|
|
$default = array(), |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns an array
- Paramètres
-
| string | $name | Variable name |
| mixed | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- array
◆ getBool()
| static getBool |
( |
|
$name, |
|
|
|
$default = false, |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a given filtered variable. The bool filter will only return true/false bool values. This is currently only a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
- Paramètres
-
| string | $name | Variable name |
| bool | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- bool Requested variable
◆ getCmd()
| static getCmd |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a given filtered variable. The cmd filter only allows the characters [A-Za-z0-9.-_] and returns in lower case. This is currently a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string Requested variable
◆ getEmail()
| static getEmail |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns an email address
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string email address or default if invalid
◆ getFloat()
| static getFloat |
( |
|
$name, |
|
|
|
$default = 0.0, |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a given filtered variable. The float filter only allows digits and periods. This is currently only a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
- Paramètres
-
| string | $name | Variable name |
| float | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- float Requested variable
◆ getHeader()
| static getHeader |
( |
|
$headerName, |
|
|
|
$default = '' |
|
) |
| |
|
static |
get request header
- Paramètres
-
| string | $headerName | name of header to retrieve, case insensitive |
| string | null | $default | default to return if named header is not found |
- Renvoie
- string header value or default if header was not found
◆ getInt()
| static getInt |
( |
|
$name, |
|
|
|
$default = 0, |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a given filtered variable. The integer filter will allow only digits to be returned. This is currently only a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
- Paramètres
-
| string | $name | Variable name |
| int | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- int Requested variable
◆ getIP()
| static getIP |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns an IP address
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string IP address or default if invalid
◆ getMethod()
Gets the request method
- Renvoie
- string
◆ getPath()
| static getPath |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a file (or web) path
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string Requested variable
◆ getString()
| static getString |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default', |
|
|
|
$mask = 0 |
|
) |
| |
|
static |
Fetches and returns a given filtered variable. The string filter deletes 'bad' HTML code, if not overridden by the mask. This is currently only a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
| int | $mask | Filter mask for the variable |
- Renvoie
- string Requested variable
◆ getText()
| static getText |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns raw text
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string Requested variable
◆ getUrl()
| static getUrl |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a web url
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string Requested variable
◆ getVar()
| static getVar |
( |
|
$name, |
|
|
|
$default = null, |
|
|
|
$hash = 'default', |
|
|
|
$type = 'none', |
|
|
|
$mask = 0 |
|
) |
| |
|
static |
Fetches and returns a given variable.
The default behaviour is fetching variables depending on the current request method: GET and HEAD will result in returning an entry from $_GET, POST and PUT will result in returning an entry from $_POST.
You can force the source by setting the $hash parameter:
- post $_POST
- get $_GET
- files $_FILES
- cookie $_COOKIE
- env $_ENV
- server $_SERVER
- method via current $_SERVER['REQUEST_METHOD']
- default $_REQUEST
- Paramètres
-
| string | $name | Variable name |
| mixed | $default | Default value if the variable does not exist |
| string | $hash | Source of variable value (POST, GET, FILES, COOKIE, METHOD) |
| string | $type | Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALPHANUM, CMD, BASE64, STRING, ARRAY, PATH, NONE) For more information see FilterInput::clean(). |
| int | $mask | Filter mask for the variable |
- Renvoie
- mixed Requested variable
◆ getWord()
| static getWord |
( |
|
$name, |
|
|
|
$default = '', |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
Fetches and returns a given filtered variable. The word filter only allows the characters [A-Za-z_]. This is currently only a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
- Paramètres
-
| string | $name | Variable name |
| string | $default | Default value if the variable does not exist |
| string | $hash | Where the var should come from (POST, GET, FILES, COOKIE, METHOD) |
- Renvoie
- string Requested variable
◆ hasVar()
| static hasVar |
( |
|
$name, |
|
|
|
$hash = 'default' |
|
) |
| |
|
static |
See if a variable exists in one of the request hashes
- Paramètres
-
| string | $name | variable to look for |
| string | $hash | hash to check |
- Renvoie
- boolean True if hash has an element 'name', otherwise false
◆ set()
| static set |
( |
|
$array, |
|
|
|
$hash = 'method', |
|
|
|
$overwrite = true |
|
) |
| |
|
static |
Sets a request variable
- Paramètres
-
| array | $array | An associative array of key-value pairs |
| string | $hash | The request variable to set (POST, GET, FILES, METHOD) |
| boolean | $overwrite | If true and an existing key is found, the value is overwritten, otherwise it is ignored |
- Renvoie
- void
◆ setVar()
| static setVar |
( |
|
$name, |
|
|
|
$value = null, |
|
|
|
$hash = 'method', |
|
|
|
$overwrite = true |
|
) |
| |
|
static |
Set a variable in one of the request variables
- Paramètres
-
| string | $name | Name |
| string | $value | Value |
| string | $hash | Hash |
| boolean | $overwrite | Boolean |
- Renvoie
- string Previous value
◆ stripSlashesRecursive()
| static stripSlashesRecursive |
( |
|
$value | ) |
|
|
staticprotected |
Strips slashes recursively on an array
- Paramètres
-
| string | array | $value | string of Array of (nested arrays of) strings |
- Renvoie
- array The input array with stripslashes applied to it
◆ MASK_ALLOW_HTML
| const MASK_ALLOW_HTML = 4 |
◆ MASK_ALLOW_RAW
◆ MASK_NO_TRIM
Available masks for cleaning variables
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/libraries/vendor/xoops/xmf/src/Request.php