W3cubDocs

/Drupal 8

protected static property 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 91

Class

Renderer
Turns a render array into a HTML string.

Namespace

Drupal\Core\Render

Code

protected static $contextCollection;

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Renderer.php/property/Renderer::contextCollection/8.1.x