function TranslateFilterForm::submitForm

Same name and namespace in other branches
  1. 10 core/modules/locale/src/Form/TranslateFilterForm.php \Drupal\locale\Form\TranslateFilterForm::submitForm()
  2. 11.x core/modules/locale/src/Form/TranslateFilterForm.php \Drupal\locale\Form\TranslateFilterForm::submitForm()
  3. 9 core/modules/locale/src/Form/TranslateFilterForm.php \Drupal\locale\Form\TranslateFilterForm::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 FormInterface::submitForm

File

core/modules/locale/src/Form/TranslateFilterForm.php, line 84

Class

TranslateFilterForm
Provides a filtered translation edit form.

Namespace

Drupal\locale\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $filters = $this->translateFilters();
  foreach ($filters as $name => $filter) {
    if ($form_state->hasValue($name)) {
      $_SESSION['locale_translate_filter'][$name] = $form_state->getValue($name);
    }
  }
  $form_state->setRedirect('locale.translate_page');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.