You are here

public function DeleteForm::getCancelUrl in Drupal 9

Same name in this branch
  1. 9 core/modules/comment/src/Form/DeleteForm.php \Drupal\comment\Form\DeleteForm::getCancelUrl()
  2. 9 core/modules/forum/src/Form/DeleteForm.php \Drupal\forum\Form\DeleteForm::getCancelUrl()
Same name and namespace in other branches
  1. 8 core/modules/comment/src/Form/DeleteForm.php \Drupal\comment\Form\DeleteForm::getCancelUrl()

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

Return value

\Drupal\Core\Url A URL object.

Overrides ContentEntityDeleteForm::getCancelUrl

1 call to DeleteForm::getCancelUrl()
DeleteForm::getRedirectUrl in core/modules/comment/src/Form/DeleteForm.php
Returns the URL where the user should be redirected after deletion.

File

core/modules/comment/src/Form/DeleteForm.php, line 17

Class

DeleteForm
Provides the comment delete confirmation form.

Namespace

Drupal\comment\Form

Code

public function getCancelUrl() {

  // Point to the entity of which this comment is a reply.
  return $this->entity
    ->get('entity_id')->entity
    ->toUrl();
}