You are here

public function FileUploadForm::uploadButtonSubmit in Media Directories 8

Same name and namespace in other branches
  1. 3.x modules/media_directories_ui/src/Form/FileUploadForm.php \Drupal\media_directories_ui\Form\FileUploadForm::uploadButtonSubmit()
  2. 2.x modules/media_directories_ui/src/Form/FileUploadForm.php \Drupal\media_directories_ui\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.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

modules/media_directories_ui/src/Form/FileUploadForm.php, line 218

Class

FileUploadForm
A form to upload files.

Namespace

Drupal\media_directories_ui\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);
}