You are here

public function Markup::render_item in Views XML Backend 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 XmlFieldHelperTrait::render_item

See also

\Drupal\views\Plugin\views\field\MultiItemsFieldHandlerInterface

File

src/Plugin/views/field/Markup.php, line 97
Contains \Drupal\views_xml_backend\Plugin\views\field\Markup.

Class

Markup
A handler to provide an XML markup field.

Namespace

Drupal\views_xml_backend\Plugin\views\field

Code

public function render_item($count, $item) {
  $text = str_replace('<!--break-->', '', $item['value']);
  $build = [
    '#type' => 'processed_text',
    '#text' => $text,
    '#format' => $this->options['format'],
    '#filter_types_to_skip' => [],
    '#langcode' => '',
  ];
  return $this->renderer
    ->renderPlain($build);
}