You are here

protected function Renderer::getCurrentRenderContext in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::getCurrentRenderContext()

Returns the current render context.

Return value

\Drupal\Core\Render\RenderContext The current render context.

3 calls to Renderer::getCurrentRenderContext()
Renderer::doRender in core/lib/Drupal/Core/Render/Renderer.php
See the docs for ::render().
Renderer::executeInRenderContext in core/lib/Drupal/Core/Render/Renderer.php
Executes a callable within a render context.
Renderer::hasRenderContext in core/lib/Drupal/Core/Render/Renderer.php
Checks whether a render context is active.

File

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

Class

Renderer
Turns a render array into a HTML string.

Namespace

Drupal\Core\Render

Code

protected function getCurrentRenderContext() {
  $request = $this->requestStack
    ->getCurrentRequest();
  return isset(static::$contextCollection[$request]) ? static::$contextCollection[$request] : NULL;
}