You are here

function views_handler_field_serialized::render in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 7.3 handlers/views_handler_field_serialized.inc \views_handler_field_serialized::render()

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field_serialized.inc, line 48

Class

views_handler_field_serialized
Field handler to show data of serialized fields.

Code

function render($values) {
  $value = $values->{$this->field_alias};
  if ($this->options['format'] == 'unserialized') {
    return check_plain(print_r(unserialize($value), TRUE));
  }
  elseif ($this->options['format'] == 'key' && !empty($this->options['key'])) {
    $value = (array) unserialize($value);
    return check_plain($value[$this->options['key']]);
  }
  return $value;
}