You are here

public function ProfileDeleteForm::getCancelUrl in Profile 8

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 ProfileDeleteForm::getCancelUrl()
ProfileDeleteForm::getRedirectUrl in src/Form/ProfileDeleteForm.php
Returns the URL where the user should be redirected after deletion.

File

src/Form/ProfileDeleteForm.php, line 35

Class

ProfileDeleteForm
Provides a confirmation form for deleting a profile entity.

Namespace

Drupal\profile\Form

Code

public function getCancelUrl() {

  /** @var \Drupal\profile\Entity\ProfileInterface $entity */
  $entity = $this->entity;
  if ($entity
    ->getOwnerId()) {
    return Url::fromRoute('entity.user.canonical', [
      'user' => $entity
        ->getOwnerId(),
    ]);
  }
  return Url::fromRoute('entity.profile.collection');
}