function File::render_link

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

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

3 calls to File::render_link()
File::render in drupal/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php
Render the field.
FileMime::render in drupal/core/modules/file/lib/Drupal/file/Plugin/views/field/FileMime.php
Render the field.
Uri::render in drupal/core/modules/file/lib/Drupal/file/Plugin/views/field/Uri.php
Render the field.

File

drupal/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php, line 59
Definition of Drupal\file\Plugin\views\field\File.

Class

File
Field handler to provide simple renderer that allows linking to a file.

Namespace

Drupal\file\Plugin\views\field

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_file']) && $data !== NULL && $data !== '') {
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = file_create_url($this
      ->getValue($values, 'uri'));
  }
  return $data;
}