You are here

protected function PlaceholderingRenderCache::getFromPlaceholderResultsCache in Drupal 8

Same name and namespace in other branches
  1. 9 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 179

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