You are here

public function AdvbanSearchForm::submitForm in Advanced ban 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/AdvbanSearchForm.php, line 159

Class

AdvbanSearchForm
Search banned IP addresses.

Namespace

Drupal\advban\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $ip = trim($form_state
    ->getValue('ip'));
  if (!empty($ip)) {
    $form_state
      ->setRedirect('advban.search', [
      'ip' => $ip,
    ]);
  }
}