function RevisionRevertForm::getCancelUrl

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php \Drupal\Core\Entity\Form\RevisionRevertForm::getCancelUrl()

Overrides ConfirmFormInterface::getCancelUrl

File

core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php, line 123

Class

RevisionRevertForm
Provides a form for reverting an entity revision.

Namespace

Drupal\Core\Entity\Form

Code

public function getCancelUrl() {
    return $this->getEntity()
        ->getEntityType()
        ->hasLinkTemplate('version-history') && $this->getEntity()
        ->toUrl('version-history')
        ->access($this->currentUser) ? $this->getEntity()
        ->toUrl('version-history') : $this->getEntity()
        ->toUrl();
}

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