You are here

function views_handler_field_file_size::render in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 handlers/views_handler_field.inc \views_handler_field_file_size::render()
  2. 7.3 handlers/views_handler_field.inc \views_handler_field_file_size::render()

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field.inc, line 1201

Class

views_handler_field_file_size
Render a numeric value as a size.

Code

function render($values) {
  $value = $this
    ->get_value($values);
  if ($value) {
    switch ($this->options['file_size_display']) {
      case 'bytes':
        return $value;
      case 'formatted':
      default:
        return format_size($value);
    }
  }
  else {
    return '';
  }
}