function AttachmentsTrait::addAttachments

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/AttachmentsTrait.php \Drupal\Core\Render\AttachmentsTrait::addAttachments()
  2. 8.9.x core/lib/Drupal/Core/Render/AttachmentsTrait.php \Drupal\Core\Render\AttachmentsTrait::addAttachments()
  3. 11.x core/lib/Drupal/Core/Render/AttachmentsTrait.php \Drupal\Core\Render\AttachmentsTrait::addAttachments()
2 calls to AttachmentsTrait::addAttachments()
BubbleableMetadata::addCacheableDependency in core/lib/Drupal/Core/Render/BubbleableMetadata.php
FilterProcessResult::createPlaceholder in core/modules/filter/src/FilterProcessResult.php
Creates a placeholder.

File

core/lib/Drupal/Core/Render/AttachmentsTrait.php, line 29

Class

AttachmentsTrait
Provides an implementation of AttachmentsInterface.

Namespace

Drupal\Core\Render

Code

public function addAttachments(array $attachments) {
    $this->attachments = BubbleableMetadata::mergeAttachments($this->attachments, $attachments);
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.