function MenuLinkContentForm::save
Same name in other branches
- 9 core/modules/menu_link_content/src/Form/MenuLinkContentForm.php \Drupal\menu_link_content\Form\MenuLinkContentForm::save()
- 10 core/modules/menu_link_content/src/Form/MenuLinkContentForm.php \Drupal\menu_link_content\Form\MenuLinkContentForm::save()
- 11.x core/modules/menu_link_content/src/Form/MenuLinkContentForm.php \Drupal\menu_link_content\Form\MenuLinkContentForm::save()
Overrides EntityForm::save
File
-
core/
modules/ menu_link_content/ src/ Form/ MenuLinkContentForm.php, line 127
Class
- MenuLinkContentForm
- Provides a form to add/update content menu links.
Namespace
Drupal\menu_link_content\FormCode
public function save(array $form, FormStateInterface $form_state) {
// The entity is rebuilt in parent::submit().
$menu_link = $this->entity;
$menu_link->save();
$this->messenger()
->addStatus($this->t('The menu link has been saved.'));
$form_state->setRedirectUrl($menu_link->toUrl('canonical'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.