function TestPlaceholderingRenderCache::createPlaceholderAndRemember

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\TestPlaceholderingRenderCache::createPlaceholderAndRemember()

Create a placeholder for a renderable array and remember in a static cache.

Parameters

array $rendered_elements: A fully rendered renderable array.

array $pre_bubbling_elements: A renderable array corresponding to the state (in particular, the cacheability metadata) of $rendered_elements prior to the beginning of its rendering process, and therefore before any bubbling of child information has taken place. Only the #cache property is used by this function, so the caller may omit all other properties and children from this array.

Return value

array Renderable array with placeholder markup and the attached placeholder replacement metadata.

Overrides PlaceholderingRenderCache::createPlaceholderAndRemember

File

core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php, line 1213

Class

TestPlaceholderingRenderCache

Namespace

Drupal\Tests\Core\Render

Code

protected function createPlaceholderAndRemember(array $rendered_elements, array $pre_bubbling_elements) {
    $placeholder_element = parent::createPlaceholderAndRemember($rendered_elements, $pre_bubbling_elements);
    $this->placeholderElements[] = $placeholder_element;
    return $placeholder_element;
}

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