You are here

public function ManageForm::submitForm in Form Defaults 8

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 FormInterface::submitForm

File

src/Form/ManageForm.php, line 62

Class

ManageForm

Namespace

Drupal\Formdefaults\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $form_values = $form_state
    ->getValues();
  $_SESSION['formdefaults_search'] = $form_values['search_str'];
  if ($form_values['results']['reset_forms']) {
    foreach ($form_values['results']['reset_forms'] as $form) {
      if ($form) {
        $helper = new FormDefaultsHelper();
        $helper
          ->deleteForm($form);
      }
    }
  }
}