You are here

protected static property Renderer::$contextCollection in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::contextCollection

The render context collection.

An individual global render context is tied to the current request. We then need to maintain a different context for each request to correctly handle rendering in subrequests.

This must be static as long as some controllers rebuild the container during a request. This causes multiple renderer instances to co-exist simultaneously, render state getting lost, and therefore causing pages to fail to render correctly. As soon as it is guaranteed that during a request the same container is used, it no longer needs to be static.

Type: \Drupal\Core\Render\RenderContext[]

File

core/lib/Drupal/Core/Render/Renderer.php, line 97

Class

Renderer
Turns a render array into an HTML string.

Namespace

Drupal\Core\Render

Code

protected static $contextCollection;