You are here

views_handler_field_file_extension.inc in Views (for Drupal 7) 6.3

Same filename and directory in other branches
  1. 7.3 modules/system/views_handler_field_file_extension.inc

File

modules/system/views_handler_field_file_extension.inc
View source
<?php

/**
 * Returns a pure file extension of the file, for example 'module'.
 * @ingroup views_field_handlers
 */
class views_handler_field_file_extension extends views_handler_field {
  function render($values) {
    $value = $this
      ->get_value($values);
    if (preg_match('/\\.([^\\.]+)$/', $value, $match)) {
      return $this
        ->sanitize_value($match[1]);
    }
  }

}

Classes

Namesort descending Description
views_handler_field_file_extension Returns a pure file extension of the file, for example 'module'.