PHP Класс Elgg\Http\Input

Provides unified access to the $_GET and $_POST inputs.
С версии: 1.10.0
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) Constructor
get ( string $variable, mixed $default = null, boolean $filter_result = true ) : mixed Get some input from variables passed submitted through GET or POST.
set ( string $variable, string | string[] $value ) : void Sets an input value that may later be retrieved by get_input

Описание методов

__construct() публичный Метод

Constructor
public __construct ( )

get() публичный Метод

If using any data obtained from get_input() in a web page, please be aware that it is a possible vector for a reflected XSS attack. If you are expecting an integer, cast it to an int. If it is a string, escape quotes. Note: this function does not handle nested arrays (ex: form input of param[m][n]) because of the filtering done in htmlawed from the filter_tags call.
public get ( string $variable, mixed $default = null, boolean $filter_result = true ) : mixed
$variable string The variable name we want.
$default mixed A default value for the variable if it is not found.
$filter_result boolean If true, then the result is filtered for bad tags.
Результат mixed

set() публичный Метод

Note: this function does not handle nested arrays (ex: form input of param[m][n])
public set ( string $variable, string | string[] $value ) : void
$variable string The name of the variable
$value string | string[] The value of the variable
Результат void