function EntityLinks::getUrl
Same name and namespace in other branches
- 11.x core/modules/filter/src/Plugin/Filter/EntityLinks.php \Drupal\filter\Plugin\Filter\EntityLinks::getUrl()
Gets the generated URL object for a linked entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: A linked entity.
Return value
\Drupal\Core\GeneratedUrl The generated URL plus cacheability metadata.
1 call to EntityLinks::getUrl()
- EntityLinks::process in core/
modules/ filter/ src/ Plugin/ Filter/ EntityLinks.php - Performs the filter processing.
File
-
core/
modules/ filter/ src/ Plugin/ Filter/ EntityLinks.php, line 119
Class
- EntityLinks
- Provides the Entity Links filter.
Namespace
Drupal\filter\Plugin\FilterCode
protected static function getUrl(EntityInterface $entity) : GeneratedUrl {
if ($link_target_handler = $entity->getEntityType()
->getHandlerClass('link_target', 'view')) {
return (new $link_target_handler())->getLinkTarget($entity);
}
return $entity->toUrl()
->toString(TRUE);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.