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

Breadcrumb

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

function LinkBase::renderLink

Prepares the link to view an entity.

Parameters

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

Return value

string Returns a string for the link text.

7 calls to LinkBase::renderLink()
EntityLink::renderLink in core/modules/views/src/Plugin/views/field/EntityLink.php
Prepares the link to view an entity.
EntityLink::renderLink in core/modules/views/src/Plugin/views/field/EntityLink.php
Prepares the link to view an entity.
LinkApprove::renderLink in core/modules/comment/src/Plugin/views/field/LinkApprove.php
Prepares the link to view an entity.
LinkApprove::renderLink in core/modules/comment/src/Plugin/views/field/LinkApprove.php
Prepares the link to view an entity.
LinkBase::render in core/modules/views/src/Plugin/views/field/LinkBase.php
Renders the field.

... See full list

4 methods override LinkBase::renderLink()
ContactLink::renderLink in core/modules/contact/src/Plugin/views/field/ContactLink.php
Prepares the link to view an entity.
EntityLink::renderLink in core/modules/views/src/Plugin/views/field/EntityLink.php
Prepares the link to view an entity.
LinkApprove::renderLink in core/modules/comment/src/Plugin/views/field/LinkApprove.php
Prepares the link to view an entity.
RevisionLink::renderLink in core/modules/node/src/Plugin/views/field/RevisionLink.php
Prepares the link to view an entity.

File

core/modules/views/src/Plugin/views/field/LinkBase.php, line 210

Class

LinkBase
Field handler to present a link to an entity.

Namespace

Drupal\views\Plugin\views\field

Code

protected function renderLink(ResultRow $row) {
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['url'] = $this->getUrlInfo($row);
    $text = !empty($this->options['text']) ? $this->sanitizeValue($this->options['text']) : $this->getDefaultLabel();
    $this->addLangcode($row);
    return $text;
}

API Navigation

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