function FileSize::render in Views (for Drupal 7) 8.3
Render the field.
Parameters
$values: The values retrieved from the database.
Overrides FieldPluginBase::render
File
- lib/
Drupal/ views/ Plugin/ views/ field/ FileSize.php, line 43 - Definition of Drupal\views\Plugin\views\field\FileSize.
Class
- FileSize
- Render a numeric value as a size.
Namespace
Drupal\views\Plugin\views\fieldCode
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 '';
}
}