3 namespace Drupal\Core\Render;
6 * Provides an implementation of AttachmentsInterface.
8 * @see \Drupal\Core\Render\AttachmentsInterface
10 trait AttachmentsTrait {
13 * The attachments for this response.
17 protected $attachments = [];
22 public function getAttachments() {
23 return $this->attachments;
29 public function addAttachments(array $attachments) {
30 $this->attachments = BubbleableMetadata::mergeAttachments($this->attachments, $attachments);
37 public function setAttachments(array $attachments) {
38 $this->attachments = $attachments;