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

Breadcrumb

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

function EntityLink::render

Same name in this branch
  1. 11.1.x core/modules/views/src/Plugin/views/field/EntityLink.php \Drupal\views\Plugin\views\field\EntityLink::render()

Overrides FieldPluginBase::render

File

core/modules/comment/src/Plugin/views/field/EntityLink.php, line 75

Class

EntityLink
Handler for showing comment module's entity links.

Namespace

Drupal\comment\Plugin\views\field

Code

public function render(ResultRow $values) {
    $entity = $this->getEntity($values);
    // Only render the links, if they are defined.
    if (!$entity || empty($this->build[$entity->id()]['links']['comment__comment'])) {
        return '';
    }
    return \Drupal::service('renderer')->render($this->build[$entity->id()]['links']['comment__comment']);
}

API Navigation

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