You are here

public static function File::processFile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Render/Element/File.php \Drupal\Core\Render\Element\File::processFile()

Processes a file upload element, make use of #multiple if present.

File

core/lib/Drupal/Core/Render/Element/File.php, line 50
Contains \Drupal\Core\Render\Element\File.

Class

File
Provides a form element for uploading a file.

Namespace

Drupal\Core\Render\Element

Code

public static function processFile(&$element, FormStateInterface $form_state, &$complete_form) {
  if ($element['#multiple']) {
    $element['#attributes'] = array(
      'multiple' => 'multiple',
    );
    $element['#name'] .= '[]';
  }
  return $element;
}