Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityLink.php

function EntityLink::getUrlInfo

Overrides LinkBase::getUrlInfo

1 call to EntityLink::getUrlInfo()
EntityLink::renderLink in core/modules/views/src/Plugin/views/field/EntityLink.php
Prepares the link to view an entity.

File

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

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 ($entity === NULL) {
        return NULL;
    }
    if ($this->languageManager
        ->isMultilingual()) {
        $entity = $this->getEntityTranslationByRelationship($entity, $row);
    }
    return $entity->toUrl($template)
        ->setAbsolute($this->options['absolute']);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal