EntityDeleteFormTrait::getCancelUrl

public EntityDeleteFormTrait::getCancelUrl()

File

core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php, line 77

Class

EntityDeleteFormTrait
Provides a trait for an entity deletion form.

Namespace

Drupal\Core\Entity

Code

public function getCancelUrl() {
  $entity = $this->getEntity();
  if ($entity->hasLinkTemplate('collection')) {
    // If available, return the collection URL.
    return $entity->urlInfo('collection');
  }
  else {
    // Otherwise fall back to the default link template.
    return $entity->urlInfo();
  }
}
doc_Drupal
2016-10-29 09:05:08
Comments
Leave a Comment

Please login to continue.