class ParameterBag implements IteratorAggregate, Countable
ParameterBag is a container for key/value pairs.
protected | $parameters | Parameter storage. |
__construct(array $parameters = array()) | ||
array | all() Returns the parameters. | |
array | keys() Returns the parameter keys. | |
replace(array $parameters = array()) Replaces the current parameters by a new set. | ||
add(array $parameters = array()) Adds parameters. | ||
mixed | get(string $key, mixed $default = null) Returns a parameter by name. | |
set(string $key, mixed $value) Sets a parameter by name. | ||
bool | has(string $key) Returns true if the parameter is defined. | |
remove(string $key) Removes a parameter. | ||
string | getAlpha(string $key, string $default = '') Returns the alphabetic characters of the parameter value. | |
string | getAlnum(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. | |
string | getDigits(string $key, string $default = '') Returns the digits of the parameter value. | |
int | getInt(string $key, int $default = 0) Returns the parameter value converted to integer. | |
bool | getBoolean(string $key, mixed $default = false) Returns the parameter value converted to boolean. | |
mixed | filter(string $key, mixed $default = null, int $filter = FILTER_DEFAULT, mixed $options = array()) Filter key. | |
ArrayIterator | getIterator() Returns an iterator for parameters. | |
int | count() Returns the number of parameters. |
array | $parameters | An array of parameters |
Returns the parameters.
array | An array of parameters |
Returns the parameter keys.
array | An array of parameter keys |
Replaces the current parameters by a new set.
array | $parameters | An array of parameters |
Adds parameters.
array | $parameters | An array of parameters |
Returns a parameter by name.
string | $key | The key |
mixed | $default | The default value if the parameter key does not exist |
mixed |
Sets a parameter by name.
string | $key | The key |
mixed | $value | The value |
Returns true if the parameter is defined.
string | $key | The key |
bool | true if the parameter exists, false otherwise |
Removes a parameter.
string | $key | The key |
Returns the alphabetic characters of the parameter value.
string | $key | The parameter key |
string | $default | The default value if the parameter key does not exist |
string | The filtered value |
Returns the alphabetic characters and digits of the parameter value.
string | $key | The parameter key |
string | $default | The default value if the parameter key does not exist |
string | The filtered value |
Returns the digits of the parameter value.
string | $key | The parameter key |
string | $default | The default value if the parameter key does not exist |
string | The filtered value |
Returns the parameter value converted to integer.
string | $key | The parameter key |
int | $default | The default value if the parameter key does not exist |
int | The filtered value |
Returns the parameter value converted to boolean.
string | $key | The parameter key |
mixed | $default | The default value if the parameter key does not exist |
bool | The filtered value |
Filter key.
string | $key | Key |
mixed | $default | Default = null |
int | $filter | FILTER_* constant |
mixed | $options | Filter options |
mixed |
http://php.net/manual/en/function.filter-var.php |
Returns an iterator for parameters.
ArrayIterator | An \ArrayIterator instance |
Returns the number of parameters.
int | The number of parameters |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/HttpFoundation/ParameterBag.html