function ShortcutLinkTarget::getLinkTarget
Gets the generated URL object for a linked entity's link target.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: A linked entity.
Return value
\Drupal\Core\GeneratedUrl The generated URL plus cacheability metadata.
Overrides EntityLinkTargetInterface::getLinkTarget
File
-
core/
modules/ shortcut/ src/ Entity/ ShortcutLinkTarget.php, line 26
Class
- ShortcutLinkTarget
- Provides a Shortcut link target handler.
Namespace
Drupal\shortcut\EntityCode
public function getLinkTarget(EntityInterface $entity) : GeneratedUrl {
assert($entity instanceof ShortcutInterface);
return $entity->getUrl()
->toString(TRUE);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.