function FilterDisableForm::submitForm

Same name in other branches
  1. 9 core/modules/filter/src/Form/FilterDisableForm.php \Drupal\filter\Form\FilterDisableForm::submitForm()
  2. 8.9.x core/modules/filter/src/Form/FilterDisableForm.php \Drupal\filter\Form\FilterDisableForm::submitForm()
  3. 10 core/modules/filter/src/Form/FilterDisableForm.php \Drupal\filter\Form\FilterDisableForm::submitForm()

Overrides EntityForm::submitForm

File

core/modules/filter/src/Form/FilterDisableForm.php, line 50

Class

FilterDisableForm
Provides the filter format disable form.

Namespace

Drupal\filter\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->entity
        ->disable()
        ->save();
    $this->messenger()
        ->addStatus($this->t('Disabled text format %format.', [
        '%format' => $this->entity
            ->label(),
    ]));
    $form_state->setRedirectUrl($this->getCancelUrl());
}

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