getEntityLinkTemplate example

if ($this->options['output_url_as_text']) {
      $url_info = $this->getUrlInfo($row);
      return $url_info ? $url_info->toString() : '';
    }
    return parent::renderLink($row);
  }

  /** * {@inheritdoc} */
  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']);
  }

  /** * Returns the entity link template name identifying the link route. * * @returns string * The link template name. */
Home | Imprint | This part of the site doesn't use cookies.