FileBag
class FileBag extends ParameterBag
FileBag is a container for uploaded files.
Properties
protected | $parameters | Parameter storage. | from ParameterBag |
Methods
No description
Replaces the current parameters by a new set.
Adds parameters.
Sets 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.
Fixes a malformed PHP $_FILES array.
Details
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.
bool
getBoolean(string $key, bool $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.
protected UploadedFile[]|UploadedFile|null
convertFileInformation(array|UploadedFile $file)
Converts uploaded files to UploadedFile instances.
protected array
fixPhpFilesArray($data)
Fixes a malformed PHP $_FILES array.
PHP has a bug that the format of the $_FILES array differs, depending on whether the uploaded file fields had normal field names or array-like field names ("normal" vs. "parent[child]").
This method fixes the array to look like the "normal" $_FILES array.
It's safe to pass an already converted array, in which case this method just returns the original array unmodified.