You are here

public function ConditionalFieldEditFormTab::submitForm in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x 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 26

Class

ConditionalFieldEditFormTab
Class ConditionalFieldEditFormTab.

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);
}