BigPipe::renderPlaceholder

protected BigPipe::renderPlaceholder($placeholder, array $placeholder_render_array)

Renders a placeholder, and just that placeholder.

BigPipe renders placeholders independently of the rest of the content, so it needs to be able to render placeholders by themselves.

Parameters

string $placeholder: The placeholder to render.

array $placeholder_render_array: The render array associated with that placeholder.

Return value

array The render array representing the rendered placeholder.

See also

\Drupal\Core\Render\RendererInterface::renderPlaceholder()

File

core/modules/big_pipe/src/Render/BigPipe.php, line 518

Class

BigPipe
The default BigPipe service.

Namespace

Drupal\big_pipe\Render

Code

protected function renderPlaceholder($placeholder, array $placeholder_render_array) {
  $elements = [
    '#markup' => $placeholder,
    '#attached' => [
      'placeholders' => [
        $placeholder => $placeholder_render_array,
      ],
    ],
  ];
  return $this->renderer->renderPlaceholder($placeholder, $elements);
}
doc_Drupal
2016-10-29 08:46:14
Comments
Leave a Comment

Please login to continue.