You are here

public function Form::getFiles in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Form.php \Symfony\Component\DomCrawler\Form::getFiles()

Gets the file field values.

Return value

array An array of 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 111

Class

Form
Form represents an HTML form.

Namespace

Symfony\Component\DomCrawler

Code

public function getFiles() {
  if (!in_array($this
    ->getMethod(), array(
    'POST',
    'PUT',
    'DELETE',
    'PATCH',
  ))) {
    return array();
  }
  $files = array();
  foreach ($this->fields
    ->all() as $name => $field) {
    if ($field
      ->isDisabled()) {
      continue;
    }
    if ($field instanceof Field\FileFormField) {
      $files[$name] = $field
        ->getValue();
    }
  }
  return $files;
}