You are here

public function TabDeleteForm::submitForm in Block Tabs 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/TabDeleteForm.php, line 69

Class

TabDeleteForm
Form for deleting a tab.

Namespace

Drupal\blocktabs\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->blockTabs
    ->deleteTab($this->tab);
  \Drupal::messenger()
    ->addMessage($this
    ->t('The tab %name has been deleted.', [
    '%name' => $this->tab
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this->blockTabs
    ->toUrl('edit-form'));
}