Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php \Drupal\Core\Entity\Form\DeleteMultipleForm::getCancelUrl()
  2. 9 core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php \Drupal\Core\Entity\Form\DeleteMultipleForm::getCancelUrl()

Returns the route to go to if the user cancels the action.

Return value

\Drupal\Core\Url A URL object.

Overrides ConfirmFormInterface::getCancelUrl

2 calls to DeleteMultipleForm::getCancelUrl()
DeleteMultipleForm::buildForm in core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php
Form constructor.
DeleteMultipleForm::submitForm in core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php
Form submission handler.
2 methods override DeleteMultipleForm::getCancelUrl()
ConfirmDeleteMultiple::getCancelUrl in core/modules/comment/src/Form/ConfirmDeleteMultiple.php
Returns the route to go to if the user cancels the action.
DeleteMultiple::getCancelUrl in core/modules/node/src/Form/DeleteMultiple.php
Returns the route to go to if the user cancels the action.

File

core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php, line 132

Class

DeleteMultipleForm
Provides an entities deletion confirmation form.

Namespace

Drupal\Core\Entity\Form

Code

public function getCancelUrl() {
  if ($this->entityType
    ->hasLinkTemplate('collection')) {
    return new Url('entity.' . $this->entityTypeId . '.collection');
  }
  else {
    return new Url('<front>');
  }
}