You are here

public function RevisionRevertForm::getCancelUrl in Entity API 8

Same name and namespace in other branches
  1. 8.0 src/Form/RevisionRevertForm.php \Drupal\entity\Form\RevisionRevertForm::getCancelUrl()

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

Return value

\Drupal\Core\Url A URL object.

Overrides ConfirmFormInterface::getCancelUrl

File

src/Form/RevisionRevertForm.php, line 80

Class

RevisionRevertForm

Namespace

Drupal\entity\Form

Code

public function getCancelUrl() {
  if ($this->revision
    ->getEntityType()
    ->hasLinkTemplate('version-history')) {
    return $this->revision
      ->toUrl('version-history');
  }
  return $this->revision
    ->toUrl();
}