function LinkBase::renderLink
Same name and namespace in other branches
- 11.x core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\LinkBase::renderLink()
- 10 core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\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.
1 method overrides LinkBase::renderLink()
- 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/ LinkBase.php, line 206
Class
- LinkBase
- Field handler to present a link to an entity.
Namespace
Drupal\views\Plugin\views\fieldCode
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.