function Renderer::getCurrentRenderContext
Same name in other branches
- 9 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::getCurrentRenderContext()
- 8.9.x core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::getCurrentRenderContext()
- 10 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::getCurrentRenderContext()
Returns the current render context.
Return value
\Drupal\Core\Render\RenderContext|null 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 608
Class
- Renderer
- Turns a render array into an HTML string.
Namespace
Drupal\Core\RenderCode
protected function getCurrentRenderContext() {
$request = $this->requestStack
->getCurrentRequest();
return static::$contextCollection[$request] ?? NULL;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.