function FileUploadForm::uploadButtonSubmit

Same name in other branches
  1. 9 core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::uploadButtonSubmit()
  2. 8.9.x core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::uploadButtonSubmit()
  3. 11.x core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::uploadButtonSubmit()

Submit handler for the upload button, inside the managed_file element.

Parameters

array $form: The form render array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

File

core/modules/media_library/src/Form/FileUploadForm.php, line 314

Class

FileUploadForm
Creates a form to create media entities from uploaded files.

Namespace

Drupal\media_library\Form

Code

public function uploadButtonSubmit(array $form, FormStateInterface $form_state) {
    $files = $this->entityTypeManager
        ->getStorage('file')
        ->loadMultiple($form_state->getValue('upload', []));
    $this->processInputValues($files, $form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.