You are here

public static function SchemaFormBuilder::sequenceHandlerAjax in Migrate API 8

Same name and namespace in other branches
  1. 8.2 src/SchemaFormBuilder.php \Drupal\migrate_api\SchemaFormBuilder::sequenceHandlerAjax()

Handle the AJAX response aspect of the "Add another" sequence form.

File

src/SchemaFormBuilder.php, line 212
Contains \Drupal\migrate_api\SchemaFormBuilder.

Class

SchemaFormBuilder
Builds forms from schema.

Namespace

Drupal\migrate_api

Code

public static function sequenceHandlerAjax(array $form, FormStateInterface $form_state) {
  $add_button = $form_state
    ->getTriggeringElement();
  $parents = $add_button['#array_parents'];
  array_pop($parents);
  $form_fragment = NestedArray::getValue($form, $parents);
  return $form_fragment;
}