function ContentEntityDeleteForm::getCancelUrl

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::getCancelUrl()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::getCancelUrl()
  3. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::getCancelUrl()
1 method overrides ContentEntityDeleteForm::getCancelUrl()
MenuLinkContentDeleteForm::getCancelUrl in core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php
Returns the route to go to if the user cancels the action.

File

core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php, line 82

Class

ContentEntityDeleteForm
Provides a generic base class for a content entity deletion form.

Namespace

Drupal\Core\Entity

Code

public function getCancelUrl() {
  /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  $entity = $this->getEntity();
  return $entity->isDefaultTranslation() ? $this->traitGetCancelUrl() : $entity->toUrl('canonical');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.