Renderer::mergeBubbleableMetadata

public Renderer::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.

Overrides RendererInterface::mergeBubbleableMetadata

See also

\Drupal\Core\Render\BubbleableMetadata

File

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

Class

Renderer
Turns a render array into a HTML string.

Namespace

Drupal\Core\Render

Code

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;
}
doc_Drupal
2016-10-29 09:37:35
Comments
Leave a Comment

Please login to continue.