You are here

public function RenderStack::addRecursionStorage in Render cache 7.2

Adds assets to the current stack frame and removes them from the render array.

Parameters

array $render: The render array to retrieve and remove the assets from.

bool $collect_attached: Whether or not #attached assets should be collected.

Overrides RenderStackInterface::addRecursionStorage

6 calls to RenderStack::addRecursionStorage()
RenderStack::drupalRender in src/Cache/RenderStack.php
@codeCoverageIgnore
RenderStack::drupal_add_assets in src/Cache/RenderStack.php
Helper function to add JS/CSS assets to the recursion storage.
RenderStack::drupal_add_library in src/Cache/RenderStack.php
Helper function to add library assets to the recursion storage.
RenderStack::drupal_process_attached in src/Cache/RenderStack.php
Helper function to add any #attached assets to the recursion storage.
RenderStack::processPostRenderCache in src/Cache/RenderStack.php

... See full list

File

src/Cache/RenderStack.php, line 143
Contains \Drupal\render_cache\Cache\RenderStack

Class

RenderStack
Defines the RenderStack service.

Namespace

Drupal\render_cache\Cache

Code

public function addRecursionStorage(array &$render, $collect_attached = FALSE) {
  $storage = $this
    ->collectAndRemoveAssets($render);
  if ($collect_attached) {
    $storage['#attached'] = $this
      ->collectAttached($render);
  }
  $this->recursionStorage[$this->recursionLevel][] = $storage;
  return $storage;
}