Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BubbleableMetadata.php

function BubbleableMetadata::applyTo

Applies the values of this bubbleable metadata object to a render array.

Parameters

array &$build: A render array.

Overrides CacheableMetadata::applyTo

File

core/lib/Drupal/Core/Render/BubbleableMetadata.php, line 52

Class

BubbleableMetadata
Value object used for bubbleable rendering metadata.

Namespace

Drupal\Core\Render

Code

public function applyTo(array &$build) {
    parent::applyTo($build);
    $build['#attached'] = $this->attachments;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal