function Renderer::renderPlaceholder

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::renderPlaceholder()
  2. 8.9.x core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::renderPlaceholder()
  3. 10 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::renderPlaceholder()

Overrides RendererInterface::renderPlaceholder

1 call to Renderer::renderPlaceholder()
Renderer::replacePlaceholders in core/lib/Drupal/Core/Render/Renderer.php
Replaces placeholders.

File

core/lib/Drupal/Core/Render/Renderer.php, line 180

Class

Renderer
Turns a render array into an HTML string.

Namespace

Drupal\Core\Render

Code

public function renderPlaceholder($placeholder, array $elements) {
    // Get the render array for the given placeholder
    $placeholder_element = $elements['#attached']['placeholders'][$placeholder];
    $markup = $this->doRenderPlaceholder($placeholder_element);
    return $this->doReplacePlaceholder($placeholder, $markup, $elements, $placeholder_element);
}

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