function LinkBase::render

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\LinkBase::render()
  2. 8.9.x core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\LinkBase::render()
  3. 10 core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\LinkBase::render()

Overrides FieldPluginBase::render

1 call to LinkBase::render()
EntityLink::render in core/modules/views/src/Plugin/views/field/EntityLink.php
Renders the field.
1 method overrides LinkBase::render()
EntityLink::render in core/modules/views/src/Plugin/views/field/EntityLink.php
Renders the field.

File

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

Class

LinkBase
Field handler to present a link to an entity.

Namespace

Drupal\views\Plugin\views\field

Code

public function render(ResultRow $row) {
    $access = $this->checkUrlAccess($row);
    if ($access) {
        $build = [
            '#markup' => $access->isAllowed() ? $this->renderLink($row) : '',
        ];
        BubbleableMetadata::createFromObject($access)->applyTo($build);
        return $build;
    }
    return '';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.