You are here

public function SearchApiFieldTrait::sanitizeValue in Search API 8

Sanitizes the value for output.

Parameters

mixed $value: The value being rendered.

string|null $type: (optional) The type of sanitization needed. If not provided, \Drupal\Component\Utility\Html::escape() is used.

Return value

\Drupal\Component\Render\MarkupInterface Returns the safe value.

See also

\Drupal\views\Plugin\views\HandlerBase::sanitizeValue()

3 calls to SearchApiFieldTrait::sanitizeValue()
SearchApiFieldTrait::combineHighlightedValues in src/Plugin/views/field/SearchApiFieldTrait.php
Combines raw field values with highlighted ones to get a complete set.
SearchApiFieldTrait::renderItems in src/Plugin/views/field/SearchApiFieldTrait.php
Renders all items in this field together.
SearchApiStandard::render_item in src/Plugin/views/field/SearchApiStandard.php
Renders a single item of a row.

File

src/Plugin/views/field/SearchApiFieldTrait.php, line 1268

Class

SearchApiFieldTrait
Provides a trait to use for Search API Views field handlers.

Namespace

Drupal\search_api\Plugin\views\field

Code

public function sanitizeValue($value, $type = NULL) {

  // Pass-through values that are already markup objects.
  if ($value instanceof MarkupInterface) {
    return $value;
  }
  return parent::sanitizeValue($value, $type);
}