public function weather_handler_condition::render in Weather 7.3
Same name and namespace in other branches
- 7.2 views_handlers/weather_handler_condition.inc \weather_handler_condition::render()
Render translated condition or <img> tag.
Overrides views_handler_field::render
File
- views_handlers/
weather_handler_condition.inc, line 32 - Views handler for weather module.
Class
- weather_handler_condition
- Field handler to render the weather condition and return an <img> tag.
Code
public function render($values) {
if (is_null($values->{$this->field_alias})) {
return;
}
module_load_include('inc', 'weather', 'weather_theme');
$condition = weather_format_condition($values->{$this->field_alias});
if ($this->field == 'symbol') {
return weather_format_image($values->{$this->field_alias}, $condition);
}
else {
return $condition;
}
}