You are here

public static function InteractiveUpload::el in Lightning Media 8

Same name and namespace in other branches
  1. 8.4 src/Element/InteractiveUpload.php \Drupal\lightning_media\Element\InteractiveUpload::el()
  2. 8.2 src/Element/InteractiveUpload.php \Drupal\lightning_media\Element\InteractiveUpload::el()
  3. 8.3 src/Element/InteractiveUpload.php \Drupal\lightning_media\Element\InteractiveUpload::el()

Returns the root element for a triggering element.

Parameters

array $form: The complete form.

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

Return value

array The root element that contains the triggering element.

2 calls to InteractiveUpload::el()
InteractiveUpload::remove in src/Element/InteractiveUpload.php
Handles form submission when the Remove button is clicked.
InteractiveUpload::upload in src/Element/InteractiveUpload.php
Handles form submission when the Upload button is clicked.

File

src/Element/InteractiveUpload.php, line 101

Class

InteractiveUpload
A form element for uploading or deleting files interactively.

Namespace

Drupal\lightning_media\Element

Code

public static function el(array &$form, FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  return NestedArray::getValue($form, array_slice($trigger['#array_parents'], 0, -1));
}