You are here

protected function EntityLink::getUrlInfo in Drupal 8

Same name and namespace in other branches
  1. 9 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()

Returns the URI elements of the link.

Parameters

\Drupal\views\ResultRow $row: A view result row.

Return value

\Drupal\Core\Url The URI elements of the link.

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']);
}