Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BigPipe.php

function BigPipe::renderPlaceholder

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()

2 calls to BigPipe::renderPlaceholder()
BigPipe::sendNoJsPlaceholders in core/modules/big_pipe/src/Render/BigPipe.php
Sends no-JS BigPipe placeholders' replacements as embedded HTML responses.
BigPipe::sendPlaceholders in core/modules/big_pipe/src/Render/BigPipe.php
Sends BigPipe placeholders' replacements as embedded AJAX responses.

File

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

Class

BigPipe
Service for sending an HTML response in chunks (to get faster page loads).

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal