public function Renderer::mergeBubbleableMetadata in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Render/Renderer.php \Drupal\Core\Render\Renderer::mergeBubbleableMetadata()
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.
Overrides RendererInterface::mergeBubbleableMetadata
See also
\Drupal\Core\Render\BubbleableMetadata
1 call to Renderer::mergeBubbleableMetadata()
- Renderer::renderPlaceholder in core/
lib/ Drupal/ Core/ Render/ Renderer.php - Renders final HTML for a placeholder.
File
- core/
lib/ Drupal/ Core/ Render/ Renderer.php, line 678
Class
- Renderer
- Turns a render array into an HTML string.
Namespace
Drupal\Core\RenderCode
public function mergeBubbleableMetadata(array $a, array $b) {
$meta_a = BubbleableMetadata::createFromRenderArray($a);
$meta_b = BubbleableMetadata::createFromRenderArray($b);
$meta_a
->merge($meta_b)
->applyTo($a);
return $a;
}