You are here

public function SearchApiEntity::render_item in Search API 8

Renders a single item of a row.

Parameters

int $count: The index of the item inside the row.

mixed $item: The item for the field to render.

Return value

string The rendered output.

Overrides SearchApiStandard::render_item

See also

\Drupal\views\Plugin\views\field\MultiItemsFieldHandlerInterface::render_item()

File

src/Plugin/views/field/SearchApiEntity.php, line 257

Class

SearchApiEntity
Handles the display of entity reference fields in Search API Views.

Namespace

Drupal\search_api\Plugin\views\field

Code

public function render_item($count, $item) {
  if (is_array($item['value'])) {
    return $this
      ->getRenderer()
      ->render($item['value']);
  }
  return parent::render_item($count, $item);
}