You are here

protected function TwigExtension::render in Components! 8

Renders a render array.

Parameters

array $render_array: The render array.

Return value

\Drupal\Component\Render\MarkupInterface The renderer markup.

1 call to TwigExtension::render()
TwigExtension::theme in src/Template/TwigExtension.php
Callback for theme function in Twig.

File

src/Template/TwigExtension.php, line 83

Class

TwigExtension
A class providing components's Twig extensions.

Namespace

Drupal\components\Template

Code

protected function render(array $render_array) {

  // This is a render array, with special simple cases already handled.
  // Early return if this element was pre-rendered (no need to re-render).
  if (isset($render_array['#printed']) && $render_array['#printed'] == TRUE && isset($render_array['#markup']) && strlen($render_array['#markup']) > 0) {
    return $render_array['#markup'];
  }
  $render_array['#printed'] = FALSE;
  return $this->renderer
    ->render($render_array);
}