You are here

protected function LinkBase::renderLink in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\LinkBase::renderLink()

Prepares the link to view a entity.

Parameters

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

Return value

string Returns a string for the link text.

5 calls to LinkBase::renderLink()
EntityLinkDelete::renderLink in core/modules/views/src/Plugin/views/field/EntityLinkDelete.php
Prepares the link to view a entity.
EntityLinkEdit::renderLink in core/modules/views/src/Plugin/views/field/EntityLinkEdit.php
Prepares the link to view a entity.
LinkApprove::renderLink in core/modules/comment/src/Plugin/views/field/LinkApprove.php
Prepares the link to view a entity.
LinkBase::render in core/modules/views/src/Plugin/views/field/LinkBase.php
Renders the field.
RevisionLink::renderLink in core/modules/node/src/Plugin/views/field/RevisionLink.php
Prepares the link to view a entity.
5 methods override LinkBase::renderLink()
ContactLink::renderLink in core/modules/contact/src/Plugin/views/field/ContactLink.php
Prepares the link to view a entity.
EntityLinkDelete::renderLink in core/modules/views/src/Plugin/views/field/EntityLinkDelete.php
Prepares the link to view a entity.
EntityLinkEdit::renderLink in core/modules/views/src/Plugin/views/field/EntityLinkEdit.php
Prepares the link to view a entity.
LinkApprove::renderLink in core/modules/comment/src/Plugin/views/field/LinkApprove.php
Prepares the link to view a entity.
RevisionLink::renderLink in core/modules/node/src/Plugin/views/field/RevisionLink.php
Prepares the link to view a entity.

File

core/modules/views/src/Plugin/views/field/LinkBase.php, line 170
Contains \Drupal\views\Plugin\views\field\LinkBase.

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;
}