function views_handler_field_boolean::render

3.x views_handler_field_boolean.inc views_handler_field_boolean::render($values)
2.x views_handler_field_boolean.inc views_handler_field_boolean::render($values)

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field_boolean.inc, line 60

Class

views_handler_field_boolean
A handler to provide proper displays for booleans.

Code

function render($values) {
  $value = $values->{$this->field_alias};
  if (!empty($this->options['not'])) {
    $value = !$value;
  }

  if (isset($this->formats[$this->options['type']])) {
    return $value ? $this->formats[$this->options['type']][0] : $this->formats[$this->options['type']][1];
  }
  else {
    return $value ? $this->formats['yes-no'][0] : $this->formats['yes-no'][1];
  }
}