function File::render_link in Views (for Drupal 7) 8.3
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 lib/
Views/ file/ Plugin/ views/ field/ File.php - Render the field.
- FileMime::render in lib/
Views/ file/ Plugin/ views/ field/ FileMime.php - Render the field.
- Uri::render in lib/
Views/ file/ Plugin/ views/ field/ Uri.php - Render the field.
File
- lib/
Views/ file/ Plugin/ views/ field/ File.php, line 60 - Definition of Views\file\Plugin\views\field\File.
Class
- File
- Field handler to provide simple renderer that allows linking to a file.
Namespace
Views\file\Plugin\views\fieldCode
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
->get_value($values, 'uri'));
}
return $data;
}