You are here

public function FacDeleteFilesForm::submitForm in Fast Autocomplete 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/FacDeleteFilesForm.php, line 109

Class

FacDeleteFilesForm
Class FacDeleteFilesForm.

Namespace

Drupal\fac\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->facConfig
    ->deleteFiles();
  $this
    ->messenger()
    ->addStatus($this
    ->t('Fast Autocomplete json files for %label have been deleted.', [
    '%label' => $this->facConfig
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}