public function entity_views_handler_field_duration::render_single_value in Entity API 7
Render a single field value.
File
- views/
handlers/ entity_views_handler_field_duration.inc, line 122 - Contains the entity_views_handler_field_duration class.
Class
- entity_views_handler_field_duration
- A handler to provide proper displays for duration properties retrieved via data selection.
Code
public function render_single_value($value, $values) {
if ($this->options['format_interval']) {
$value = format_interval($value, (int) $this->options['granularity']);
}
// Value sanitization is handled by the wrapper, see
// EntityFieldHandlerHelper::get_value().
return $this
->sanitize_value($this->options['prefix'], 'xss') . $value . $this
->sanitize_value($this->options['suffix'], 'xss');
}