You are here

public function MenuLinkResetForm::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/menu_ui/src/Form/MenuLinkResetForm.php \Drupal\menu_ui\Form\MenuLinkResetForm::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

core/modules/menu_ui/src/Form/MenuLinkResetForm.php, line 106
Contains \Drupal\menu_ui\Form\MenuLinkResetForm.

Class

MenuLinkResetForm
Defines a confirmation form for resetting a single modified menu link.

Namespace

Drupal\menu_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->link = $this->menuLinkManager
    ->resetLink($this->link
    ->getPluginId());
  drupal_set_message($this
    ->t('The menu link was reset to its default settings.'));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}