function EntityLink::getUrlInfo

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/field/EntityLink.php \Drupal\views\Plugin\views\field\EntityLink::getUrlInfo()
  2. 10 core/modules/views/src/Plugin/views/field/EntityLink.php \Drupal\views\Plugin\views\field\EntityLink::getUrlInfo()
  3. 11.x core/modules/views/src/Plugin/views/field/EntityLink.php \Drupal\views\Plugin\views\field\EntityLink::getUrlInfo()

Overrides LinkBase::getUrlInfo

File

core/modules/views/src/Plugin/views/field/EntityLink.php, line 37

Class

EntityLink
Field handler to present a link to an entity.

Namespace

Drupal\views\Plugin\views\field

Code

protected function getUrlInfo(ResultRow $row) {
    $template = $this->getEntityLinkTemplate();
    $entity = $this->getEntity($row);
    if ($this->languageManager
        ->isMultilingual()) {
        $entity = $this->getEntityTranslation($entity, $row);
    }
    return $entity->toUrl($template)
        ->setAbsolute($this->options['absolute']);
}

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