You are here

function stripe_customer_viewshandler::render in Stripe 7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field_url::render

File

stripe_customer/views/handlers/stripe_customer_viewshandler.inc, line 35
Contains stripe_customer_viewshandler.

Class

stripe_customer_viewshandler
Provides a Views handler to link a Stripe Customer ID.

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'] = 'admin/stripe/customer/' . $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, 'text');
  }
}