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

Breadcrumb

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

function BubbleableMetadata::createFromRenderArray

Creates a bubbleable metadata object with values taken from a render array.

Parameters

array $build: A render array.

Return value

static

Overrides CacheableMetadata::createFromRenderArray

6 calls to BubbleableMetadata::createFromRenderArray()
EntityField::getItems in core/modules/views/src/Plugin/views/field/EntityField.php
Gets an array of items for the field.
FormElementBase::processAutocomplete in core/lib/Drupal/Core/Render/Element/FormElementBase.php
Adds autocomplete functionality to elements.
HtmlResponseAttachmentsProcessor::renderPlaceholders in core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php
Renders placeholders (#attached['placeholders']).
MediaEmbed::renderIntoDomNode in core/modules/media/src/Plugin/Filter/MediaEmbed.php
Renders the given render array into the given DOM node.
ProcessedText::preRenderText in core/modules/filter/src/Element/ProcessedText.php
Pre-render callback: Renders a processed text element into #markup.

... See full list

File

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

Class

BubbleableMetadata
Value object used for bubbleable rendering metadata.

Namespace

Drupal\Core\Render

Code

public static function createFromRenderArray(array $build) {
    $meta = parent::createFromRenderArray($build);
    $meta->attachments = isset($build['#attached']) ? $build['#attached'] : [];
    return $meta;
}
RSS feed
Powered by Drupal