Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. File.php

function File::processFile

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

File

core/lib/Drupal/Core/Render/Element/File.php, line 52

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']['multiple'] = 'multiple';
        $element['#name'] .= '[]';
    }
    return $element;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal