You are here

function Url::render in Views (for Drupal 7) 8.3

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides FieldPluginBase::render

File

lib/Drupal/views/Plugin/views/field/Url.php, line 43
Definition of Drupal\views\Plugin\views\field\Url.

Class

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

Namespace

Drupal\views\Plugin\views\field

Code

function render($values) {
  $value = $this
    ->get_value($values);
  if (!empty($this->options['display_as_link'])) {
    return l($this
      ->sanitizeValue($value), $value, array(
      'html' => TRUE,
    ));
  }
  else {
    return $this
      ->sanitizeValue($value, 'url');
  }
}