function Form::getFiles
Gets the file field values.
1 call to Form::getFiles()
- Form::getPhpFiles in vendor/
symfony/ dom-crawler/ Form.php - Gets the file field values as PHP.
File
-
vendor/
symfony/ dom-crawler/ Form.php, line 94
Class
- Form
- Form represents an HTML form.
Namespace
Symfony\Component\DomCrawlerCode
public function getFiles() : array {
if (!\in_array($this->getMethod(), [
'POST',
'PUT',
'DELETE',
'PATCH',
])) {
return [];
}
$files = [];
foreach ($this->fields
->all() as $name => $field) {
if ($field->isDisabled()) {
continue;
}
if ($field instanceof Field\FileFormField) {
$files[$name] = $field->getValue();
}
}
return $files;
}