You are here

public function ContentEntityDeleteForm::getCancelUrl in Drupal 8

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

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

Return value

\Drupal\Core\Url A URL object.

Overrides ConfirmFormInterface::getCancelUrl

6 methods override ContentEntityDeleteForm::getCancelUrl()
DeleteForm::getCancelUrl in core/modules/comment/src/Form/DeleteForm.php
Returns the route to go to if the user cancels the action.
EntityTestDeleteForm::getCancelUrl in core/modules/system/tests/modules/entity_test/src/EntityTestDeleteForm.php
Returns the route to go to if the user cancels the action.
FeedDeleteForm::getCancelUrl in core/modules/aggregator/src/Form/FeedDeleteForm.php
Returns the route to go to if the user cancels the action.
MenuLinkContentDeleteForm::getCancelUrl in core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php
Returns the route to go to if the user cancels the action.
ShortcutDeleteForm::getCancelUrl in core/modules/shortcut/src/Form/ShortcutDeleteForm.php
Returns the route to go to if the user cancels the action.

... See full list

File

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

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');
}