function views_handler_field_url::render

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

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

handlers/views_handler_field_url.inc, line 34
Definition of views_handler_field_url.

Class

views_handler_field_url
Field handler to provide simple renderer that turns a URL into a clickable link.

Code

function render($values) {
  $value = $this->get_value($values);
  if (!empty($this->options['display_as_link'])) {
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = $value;
    $text = !empty($this->options['text']) ? $this->sanitize_value($this->options['text']) : $this->sanitize_value($value, 'url');
    return $text;
  }
  else {
    return $this->sanitize_value($value, 'url');
  }
}