function Node::render_link

Render whatever the data is as a link to the node.

Data should be made XSS safe prior to calling this function.

5 calls to Node::render_link()
HistoryUserTimestamp::render in drupal/core/modules/history/lib/Drupal/history/Plugin/views/field/HistoryUserTimestamp.php
Render the field.
Language::render in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Language.php
Render the field.
Node::render in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php
Render the field.
Revision::render_link in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php
Render whatever the data is as a link to the node.
Type::render in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Type.php
Render the field.
1 method overrides Node::render_link()
Revision::render_link in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php
Render whatever the data is as a link to the node.

File

drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php, line 66
Definition of Drupal\node\Plugin\views\field\Node.

Class

Node
Field handler to provide simple renderer that allows linking to a node. Definition terms:

Namespace

Drupal\node\Plugin\views\field

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_node']) && !empty($this->additional_fields['nid'])) {
    if ($data !== NULL && $data !== '') {
      $this->options['alter']['make_link'] = TRUE;
      $this->options['alter']['path'] = "node/" . $this
        ->getValue($values, 'nid');
      if (isset($this->aliases['langcode'])) {
        $languages = language_list();
        $langcode = $this
          ->getValue($values, 'langcode');
        if (isset($languages[$langcode])) {
          $this->options['alter']['language'] = $languages[$langcode];
        }
        else {
          unset($this->options['alter']['language']);
        }
      }
    }
    else {
      $this->options['alter']['make_link'] = FALSE;
    }
  }
  return $data;
}