\Symfony\Component\HttpFoundationInputBag

InputBag is a container for user input values such as $_GET, $_POST, $_REQUEST, and $_COOKIE.

Summary

Methods
Properties
Constants
__construct()
all()
keys()
replace()
add()
get()
set()
has()
remove()
getAlpha()
getAlnum()
getDigits()
getInt()
getBoolean()
filter()
getIterator()
count()
No public properties found
No constants found
No protected methods found
$parameters
N/A
No private methods found
No private properties found
N/A

Properties

$parameters

$parameters

Parameter storage.

Methods

__construct()

__construct(array  $parameters = []) : mixed

Parameters

array $parameters

Returns

mixed —

all()

all(string  $key = null) : array

Returns the parameters.

Parameters

string $key

Returns

array —

keys()

keys() : array

Returns the parameter keys.

Returns

array —

replace()

replace(array  $inputs = []) : mixed

Replaces the current input values by a new set.

Parameters

array $inputs

Returns

mixed —

add()

add(array  $inputs = []) : mixed

Adds input values.

Parameters

array $inputs

Returns

mixed —

get()

get(string  $key, string|int|float|bool|null  $default = null) : string|int|float|bool|null

Returns a scalar input value by name.

Parameters

string $key
string|int|float|bool|null $default

The default value if the input key does not exist

Returns

string|int|float|bool|null —

set()

set(string  $key, string|int|float|bool|array|null  $value) : mixed

Sets an input by name.

Parameters

string $key
string|int|float|bool|array|null $value

Returns

mixed —

has()

has(string  $key) : bool

Returns true if the parameter is defined.

Parameters

string $key

Returns

bool —

remove()

remove(string  $key) : mixed

Removes a parameter.

Parameters

string $key

Returns

mixed —

getAlpha()

getAlpha(string  $key, string  $default = '') : string

Returns the alphabetic characters of the parameter value.

Parameters

string $key
string $default

Returns

string —

getAlnum()

getAlnum(string  $key, string  $default = '') : string

Returns the alphabetic characters and digits of the parameter value.

Parameters

string $key
string $default

Returns

string —

getDigits()

getDigits(string  $key, string  $default = '') : string

Returns the digits of the parameter value.

Parameters

string $key
string $default

Returns

string —

getInt()

getInt(string  $key, int  $default) : int

Returns the parameter value converted to integer.

Parameters

string $key
int $default

Returns

int —

getBoolean()

getBoolean(string  $key, bool  $default = false) : bool

Returns the parameter value converted to boolean.

Parameters

string $key
bool $default

Returns

bool —

filter()

filter(string  $key, mixed  $default = null, int  $filter = FILTER_DEFAULT, mixed  $options = []) : mixed

Filter key.

Parameters

string $key
mixed $default

Default = null

int $filter

FILTER_* constant

mixed $options

Filter options

Returns

mixed —

getIterator()

getIterator() : \ArrayIterator<string,mixed>

Returns an iterator for parameters.

Returns

\ArrayIterator

count()

count() : int

Returns the number of parameters.

Returns

int —