ServerBag
class ServerBag extends ParameterBag
ServerBag is a container for HTTP headers from the $_SERVER variable.
Methods
Replaces the current parameters by a new set.
Returns a parameter by name.
Returns the alphabetic characters of the parameter value.
Returns the alphabetic characters and digits of the parameter value.
Returns the digits of the parameter value.
Returns the parameter value converted to integer.
Returns the parameter value converted to boolean.
Filter key.
Gets the HTTP headers.
Details
in ParameterBag at line line 33
__construct(array $parameters = array())
Constructor.
in ParameterBag at line line 43
array
all()
Returns the parameters.
in ParameterBag at line line 53
array
keys()
Returns the parameter keys.
in ParameterBag at line line 63
replace(array $parameters = array())
Replaces the current parameters by a new set.
in ParameterBag at line line 73
add(array $parameters = array())
Adds parameters.
in ParameterBag at line line 91
mixed
get(string $key, mixed $default = null, bool $deep = false)
Returns a parameter by name.
Note: Finding deep items is deprecated since version 2.8, to be removed in 3.0.
in ParameterBag at line line 150
set(string $key, mixed $value)
Sets a parameter by name.
in ParameterBag at line line 162
bool
has(string $key)
Returns true if the parameter is defined.
in ParameterBag at line line 172
remove(string $key)
Removes a parameter.
in ParameterBag at line line 186
string
getAlpha(string $key, string $default = '', bool $deep = false)
Returns the alphabetic characters of the parameter value.
in ParameterBag at line line 200
string
getAlnum(string $key, string $default = '', bool $deep = false)
Returns the alphabetic characters and digits of the parameter value.
in ParameterBag at line line 214
string
getDigits(string $key, string $default = '', bool $deep = false)
Returns the digits of the parameter value.
in ParameterBag at line line 229
int
getInt(string $key, int $default, bool $deep = false)
Returns the parameter value converted to integer.
in ParameterBag at line line 243
bool
getBoolean(string $key, mixed $default = false, bool $deep = false)
Returns the parameter value converted to boolean.
in ParameterBag at line line 261
mixed
filter(string $key, mixed $default = null, int $filter = FILTER_DEFAULT, mixed $options = array(), bool $deep = false)
Filter key.
in ParameterBag at line line 298
ArrayIterator
getIterator()
Returns an iterator for parameters.
in ParameterBag at line line 308
int
count()
Returns the number of parameters.
at line line 28
array
getHeaders()
Gets the HTTP headers.