You are here

public static function Upload::processFile in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 src/Element/Upload.php \Drupal\lightning_media\Element\Upload::processFile()
  2. 8 src/Element/Upload.php \Drupal\lightning_media\Element\Upload::processFile()
  3. 8.2 src/Element/Upload.php \Drupal\lightning_media\Element\Upload::processFile()

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

Overrides File::processFile

File

src/Element/Upload.php, line 80

Class

Upload
A form element to handle file uploads.

Namespace

Drupal\lightning_media\Element

Code

public static function processFile(&$element, FormStateInterface $form_state, &$complete_form) {
  $element['#name'] = implode('_', $element['#parents']);
  $form_state
    ->setHasFileElement();
  return parent::processFile($element, $form_state, $complete_form);
}