You are here

public function EntityFieldExport::renderText in REST Views 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/views/field/EntityFieldExport.php \Drupal\rest_views\Plugin\views\field\EntityFieldExport::renderText()

Performs an advanced text render for the item.

This is separated out as some fields may render lists, and this allows each item to be handled individually.

Parameters

array $alter: The alter array of options to use.

  • max_length: Maximum length of the string, the rest gets truncated.
  • word_boundary: Trim only on a word boundary.
  • ellipsis: Show an ellipsis (…) at the end of the trimmed string.
  • html: Make sure that the html is correct.

Return value

string|\Drupal\Component\Render\MarkupInterface The rendered output. If the output is safe it will be wrapped in an object that implements MarkupInterface. If it is empty or unsafe it will be a string.

Overrides FieldPluginBase::renderText

File

src/Plugin/views/field/EntityFieldExport.php, line 56

Class

EntityFieldExport
Display entity field data in a serialized display.

Namespace

Drupal\rest_views\Plugin\views\field

Code

public function renderText($alter) {
  if (isset($this->last_render) && $this->last_render instanceof SerializedData) {
    return $this->last_render;
  }
  return parent::renderText($alter);
}