You are here

public function WebformHandlerDeleteForm::submitForm in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Form/WebformHandlerDeleteForm.php \Drupal\webform\Form\WebformHandlerDeleteForm::submitForm()

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/WebformHandlerDeleteForm.php, line 108

Class

WebformHandlerDeleteForm
Form for deleting a webform handler.

Namespace

Drupal\webform\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->webform
    ->deleteWebformHandler($this->webformHandler);
  $this
    ->messenger()
    ->addStatus($this
    ->t('The webform handler %name has been deleted.', [
    '%name' => $this->webformHandler
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this->webform
    ->toUrl('handlers'));
}