You are here

public static function ParagraphsSets::setSetAjax in Paragraphs Sets 8.2

File

src/ParagraphsSets.php, line 230

Class

ParagraphsSets
Utitlity class for paragraphs_sets.

Namespace

Drupal\paragraphs_sets

Code

public static function setSetAjax(array $form, FormStateInterface $form_state) {
  $button = $form_state
    ->getTriggeringElement();

  // Go one level up in the form, to the widgets container.
  $element = NestedArray::getValue($form, array_slice($button['#array_parents'], 0, -2));
  return $element;
}