function BookRemoveForm::submitForm
Same name in other branches
- 9 core/modules/book/src/Form/BookRemoveForm.php \Drupal\book\Form\BookRemoveForm::submitForm()
- 10 core/modules/book/src/Form/BookRemoveForm.php \Drupal\book\Form\BookRemoveForm::submitForm()
- 11.x core/modules/book/src/Form/BookRemoveForm.php \Drupal\book\Form\BookRemoveForm::submitForm()
Overrides FormInterface::submitForm
File
-
core/
modules/ book/ src/ Form/ BookRemoveForm.php, line 103
Class
- BookRemoveForm
- Remove form for book module.
Namespace
Drupal\book\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
if ($this->bookManager
->checkNodeIsRemovable($this->node)) {
$this->bookManager
->deleteFromBook($this->node
->id());
$this->messenger()
->addStatus($this->t('The post has been removed from the book.'));
}
$form_state->setRedirectUrl($this->getCancelUrl());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.