function views_handler_field_file_size::render

3.x views_handler_field.inc views_handler_field_file_size::render($values)
2.x views_handler_field.inc views_handler_field_file_size::render($values)

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field.inc, line 830

Class

views_handler_field_file_size
Render a numeric value as a size.

Code

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