function NodeLink::render

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides FieldPluginBase::render

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php, line 44
Definition of Drupal\comment\Plugin\views\field\NodeLink.

Class

NodeLink
Handler for showing comment module's node link.

Namespace

Drupal\comment\Plugin\views\field

Code

function render($values) {
  $node = $this
    ->get_entity($values);
  comment_node_view($node, $this->options['teaser'] ? 'teaser' : 'full');

  // Only render the links if they are defined.
  return !empty($node->content['links']['comment']) ? drupal_render($node->content['links']['comment']) : '';
}