You are here

public function YamlFormHandlerDeleteForm::submitForm in YAML Form 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/YamlFormHandlerDeleteForm.php, line 69

Class

YamlFormHandlerDeleteForm
Form for deleting a form handler.

Namespace

Drupal\yamlform\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->yamlform
    ->deleteYamlFormHandler($this->yamlformHandler);
  drupal_set_message($this
    ->t('The form handler %name has been deleted.', [
    '%name' => $this->yamlformHandler
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this->yamlform
    ->toUrl('handlers-form'));
}