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

Breadcrumb

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

function RenderCacheInterface::getCacheableRenderArray

Gets a cacheable render array for a render array and its rendered output.

Given a render array and its rendered output (HTML string), return an array data structure that allows the render array and its associated metadata to be cached reliably (and is serialization-safe).

If Drupal needs additional rendering metadata to be cached at some point, consumers of this method will continue to work. Those who only cache certain parts of a render array will cease to work.

Parameters

array $elements: A render array, on which \Drupal\Core\Render\RendererInterface::render() has already been invoked.

Return value

array An array representing the cacheable data for this render array.

1 method overrides RenderCacheInterface::getCacheableRenderArray()
RenderCache::getCacheableRenderArray in core/lib/Drupal/Core/Render/RenderCache.php
Gets a cacheable render array for a render array and its rendered output.

File

core/lib/Drupal/Core/Render/RenderCacheInterface.php, line 33

Class

RenderCacheInterface
Defines an interface for caching rendered render arrays.

Namespace

Drupal\Core\Render

Code

public function getCacheableRenderArray(array $elements);

API Navigation

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