You are here

public function YamlFormFilterFormBase::submitForm in YAML Form 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/YamlFormFilterFormBase.php, line 58

Class

YamlFormFilterFormBase
Provides base class for form filter forms.

Namespace

Drupal\yamlform\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $query = [
    'search' => trim($form_state
      ->getValue('search')),
    'state' => trim($form_state
      ->getValue('state')),
  ];
  $form_state
    ->setRedirect($this
    ->getRouteMatch()
    ->getRouteName(), $this
    ->getRouteMatch()
    ->getRawParameters()
    ->all(), [
    'query' => $query,
  ]);
}