You are here

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

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides FieldPluginBase::render

File

lib/Views/file/Plugin/views/field/Extension.php, line 25
Definition of views_handler_field_file_extension.

Class

Extension
Returns a pure file extension of the file, for example 'module'.

Namespace

Views\file\Plugin\views\field

Code

function render($values) {
  $value = $this
    ->get_value($values);
  if (preg_match('/\\.([^\\.]+)$/', $value, $match)) {
    return $this
      ->sanitizeValue($match[1]);
  }
}