You are here

public function views_handler_field_serialized::render in Views (for Drupal 7) 7.3

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

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field_serialized.inc, line 63
Definition of views_handler_field_serialized.

Class

views_handler_field_serialized
Field handler to show data of serialized fields.

Code

public 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 check_plain($value);
}