You are here

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

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides File::render

File

lib/Views/file/Plugin/views/field/FileMime.php, line 39
Definition of Views\file\Plugin\views\field\FileMime.

Class

FileMime
Field handler to add rendering MIME type images as an option on the filemime field.

Namespace

Views\file\Plugin\views\field

Code

function render($values) {
  $data = $values->{$this->field_alias};
  if (!empty($this->options['filemime_image']) && $data !== NULL && $data !== '') {
    $fake_file = (object) array(
      'filemime' => $data,
    );
    $data = theme('file_icon', array(
      'file' => $fake_file,
    ));
  }
  return $this
    ->render_link($data, $values);
}