RendererInterface::mergeBubbleableMetadata

public RendererInterface::mergeBubbleableMetadata(array $a, array $b) Merges the bubbleable rendering metadata o/t 2nd render array with the 1st. Parameters array $a: A render array. array $b: A render array. Return value array The first render array, modified to also contain the bubbleable rendering metadata of the second render array. See also \Drupal\Core\Render\BubbleableMetadata File core/lib/Drupal/Core/Render/RendererInterface.php, line 394 Class RendererInterface Defines an inte

RendererInterface::hasRenderContext

public RendererInterface::hasRenderContext() Checks whether a render context is active. This is useful only in very specific situations to determine whether the system is already capable of collecting bubbleable metadata. Normally it should not be necessary to be concerned about this. Return value bool TRUE if the renderer has a render context active, FALSE otherwise. File core/lib/Drupal/Core/Render/RendererInterface.php, line 347 Class RendererInterface Defines an interface for turning

RendererInterface::executeInRenderContext

public RendererInterface::executeInRenderContext(RenderContext $context, callable $callable) Executes a callable within a render context. Only for very advanced use cases. Prefer using ::renderRoot() and ::renderPlain() instead. All rendering must happen within a render context. Within a render context, all bubbleable metadata is bubbled and hence tracked. Outside of a render context, it would be lost. This could lead to missing assets, incorrect cache variations (and thus security issues), ins

RendererInterface::addCacheableDependency

public RendererInterface::addCacheableDependency(array &$elements, $dependency) Adds a dependency on an object: merges its cacheability metadata. For instance, when a render array depends on some configuration, an entity, or an access result, we must make sure their cacheability metadata is present on the render array. This method makes doing that simple. Parameters array &$elements: The render array to update. \Drupal\Core\Cache\CacheableDependencyInterface|mixed $dependency: The depe

RendererInterface

Defines an interface for turning a render array into a string. Hierarchy interface \Drupal\Core\Render\RendererInterface File core/lib/Drupal/Core/Render/RendererInterface.php, line 8 Namespace Drupal\Core\Render Members Name Modifiers Type Description RendererInterface::addCacheableDependency public function Adds a dependency on an object: merges its cacheability metadata. RendererInterface::executeInRenderContext public function Executes a callable within a ren

Renderer::__construct

public Renderer::__construct(ControllerResolverInterface $controller_resolver, ThemeManagerInterface $theme, ElementInfoManagerInterface $element_info, PlaceholderGeneratorInterface $placeholder_generator, RenderCacheInterface $render_cache, RequestStack $request_stack, array $renderer_config) Constructs a new Renderer. Parameters \Drupal\Core\Controller\ControllerResolverInterface $controller_resolver: The controller resolver. \Drupal\Core\Theme\ThemeManagerInterface $theme: The theme manager

Renderer::xssFilterAdminIfUnsafe

protected Renderer::xssFilterAdminIfUnsafe($string) Applies a very permissive XSS/HTML filter for admin-only use. Note: This method only filters if $string is not marked safe already. This ensures that HTML intended for display is not filtered. Parameters string|\Drupal\Core\Render\Markup $string: A string. Return value \Drupal\Core\Render\Markup The escaped string wrapped in a Markup object. If the string is an instance of \Drupal\Component\Render\MarkupInterface, it won't be escaped again.

Renderer::setCurrentRenderContext

protected Renderer::setCurrentRenderContext(RenderContext $context = NULL) Sets the current render context. Parameters \Drupal\Core\Render\RenderContext|null $context: The render context. This can be NULL for instance when restoring the original render context, which is in fact NULL. Return value $this File core/lib/Drupal/Core/Render/Renderer.php, line 606 Class Renderer Turns a render array into a HTML string. Namespace Drupal\Core\Render Code protected function setCurrentRenderCon

Renderer::replacePlaceholders

protected Renderer::replacePlaceholders(array &$elements) Replaces placeholders. Placeholders may have: #lazy_builder callback, to build a render array to be rendered into markup that can replace the placeholder #cache: to cache the result of the placeholder Also merges the bubbleable metadata resulting from the rendering of the contents of the placeholders. Hence $elements will be contain the entirety of bubbleable metadata. @returns bool Whether placeholders were replaced. Parameters

Renderer::renderRoot

public Renderer::renderRoot(&$elements) Renders final HTML given a structured array tree. Calls ::render() in such a way that placeholders are replaced. Should therefore only be used in occasions where the final rendering is happening, just before sending a Response: system internals that are responsible for rendering the final HTML render arrays for non-HTML responses, such as feeds (Cannot be executed within another render context.) Parameters array $elements: The structured array desc