You are here

public function weather_handler_temperature::render in Weather 7.3

Same name and namespace in other branches
  1. 7.2 views_handlers/weather_handler_temperature.inc \weather_handler_temperature::render()

Render temperature with selected unit.

Overrides views_handler_field_numeric::render

File

views_handlers/weather_handler_temperature.inc, line 62
Views handler for weather module.

Class

weather_handler_temperature
Field handler to allow selection of temperature units.

Code

public function render($values) {
  if (is_null($values->{$this->field_alias})) {
    return;
  }
  $value = $values->{$this->field_alias};
  module_load_include('inc', 'weather', 'weather_theme');
  return weather_format_temperature($value, $this->options['unit']);
}