You are here

public function TemplateDeleteForm::submitForm in Workbench Email 2.x

Same name and namespace in other branches
  1. 8 src/Form/TemplateDeleteForm.php \Drupal\workbench_email\Form\TemplateDeleteForm::submitForm()

Overrides EntityDeleteFormTrait::submitForm

File

src/Form/TemplateDeleteForm.php, line 63

Class

TemplateDeleteForm
Builds the form to delete Email Template entities.

Namespace

Drupal\workbench_email\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->entity
    ->delete();
  $this->messenger
    ->addStatus($this
    ->t('Template @label deleted.', [
    '@label' => $this->entity
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}