You are here

public function ConditionalFieldEditFormTab::submitForm in Conditional Fields 4.x

Same name and namespace in other branches
  1. 8 src/Form/ConditionalFieldEditFormTab.php \Drupal\conditional_fields\Form\ConditionalFieldEditFormTab::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides ConditionalFieldEditForm::submitForm

File

src/Form/ConditionalFieldEditFormTab.php, line 31

Class

ConditionalFieldEditFormTab
A form to edit a conditional field, designed to be displayed in a tab.

Namespace

Drupal\conditional_fields\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $values = $form_state
    ->cleanValues()
    ->getValues();
  $parameters = [
    "{$values['entity_type']}_type" => $values['bundle'],
  ];
  $redirect = $this->redirectPath . "." . $values['entity_type'];
  $form_state
    ->setRedirect($redirect, $parameters);
}