You are here

function NcsLastCommentName::render in Views (for Drupal 7) 8.3

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides FieldPluginBase::render

File

lib/Views/comment/Plugin/views/field/NcsLastCommentName.php, line 63
Definition of Views\comment\Plugin\views\field\NcsLastCommentName.

Class

NcsLastCommentName
Field handler to present the name of the last comment poster.

Namespace

Views\comment\Plugin\views\field

Code

function render($values) {
  if (!empty($this->options['link_to_user'])) {
    $account = entity_create('user', array());
    $account->name = $this
      ->get_value($values);
    $account->uid = $values->{$this->uid};
    return theme('username', array(
      'account' => $account,
    ));
  }
  else {
    return $this
      ->sanitizeValue($this
      ->get_value($values));
  }
}