You are here

public function DeleteMultipleForm::getCancelUrl in Drupal 9

Same name and namespace in other branches
  1. 8 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

1 call to DeleteMultipleForm::getCancelUrl()
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>');
  }
}