function views_handler_field_serialized::render

Same name in other branches
  1. 7.x-3.x handlers/views_handler_field_serialized.inc \views_handler_field_serialized::render()

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;
}