You are here

public function FileUploadForm::uploadButtonSubmit in Drupal 9

Same name and namespace in other branches
  1. 8 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 297

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);
}