function FieldHandlerInterface::renderText

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php \Drupal\views\Plugin\views\field\FieldHandlerInterface::renderText()
  2. 8.9.x core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php \Drupal\views\Plugin\views\field\FieldHandlerInterface::renderText()
  3. 11.x core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php \Drupal\views\Plugin\views\field\FieldHandlerInterface::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 a 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

\Drupal\Component\Render\MarkupInterface|string 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.

1 method overrides FieldHandlerInterface::renderText()
FieldPluginBase::renderText in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Performs an advanced text render for the item.

File

core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php, line 254

Class

FieldHandlerInterface
Base field handler that has no options and renders an unformatted field.

Namespace

Drupal\views\Plugin\views\field

Code

public function renderText($alter);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.