function FileUploadForm::uploadButtonSubmit
Same name in other branches
- 8.9.x core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::uploadButtonSubmit()
- 10 core/modules/media_library/src/Form/FileUploadForm.php \Drupal\media_library\Form\FileUploadForm::uploadButtonSubmit()
- 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 313
Class
- FileUploadForm
- Creates a form to create media entities from uploaded files.
Namespace
Drupal\media_library\FormCode
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.