function PlaceholderingRenderCache::getFromPlaceholderResultsCache

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

Retrieves an auto-placeholdered renderable array from the static cache.

Parameters

array $elements: A renderable array.

Return value

array|false A renderable array, with the original element and all its children pre- rendered, or FALSE if no cached copy of the element is available.

1 call to PlaceholderingRenderCache::getFromPlaceholderResultsCache()
PlaceholderingRenderCache::get in core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php
Gets the cached, pre-rendered element of a renderable element from cache.

File

core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php, line 174

Class

PlaceholderingRenderCache
Adds automatic placeholdering to the RenderCache.

Namespace

Drupal\Core\Render

Code

protected function getFromPlaceholderResultsCache(array $elements) {
    $placeholder_element = $this->placeholderGenerator
        ->createPlaceholder($elements);
    $placeholder = (string) $placeholder_element['#markup'];
    if (isset($this->placeholderResultsCache[$placeholder])) {
        return $this->placeholderResultsCache[$placeholder];
    }
    return FALSE;
}

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