1 views_handler_field_file_icon.inc protected views_handler_field_file_icon::renderSvg($icon_name, $extension)

Render the icon as svg tag.

File

core/modules/file/views/views_handler_field_file_icon.inc, line 81
Definition of views_handler_field_file_icon.

Class

views_handler_field_file_icon

Code

protected function renderSvg($icon_name, $extension) {
  $options = array(
    'attributes' => array(
      'width' => $this->options['icon_size'],
      'height' => $this->options['icon_size'],
    ),
  );
  if ($this->options['add_alt_text']) {
    $options['alt'] = t('File icon for @extension extension', array(
      '@extension' => $extension,
    ));
  }
  return icon($icon_name, $options);
}