Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/Render/BubbleableMetadata.php \Drupal\Core\Render\BubbleableMetadata::createFromRenderArray()
- 9 core/lib/Drupal/Core/Render/BubbleableMetadata.php \Drupal\Core\Render\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
10 calls to BubbleableMetadata::createFromRenderArray()
- Actions::preRenderActionsDropbutton in core/
lib/ Drupal/ Core/ Render/ Element/ Actions.php - #pre_render callback for #type 'actions'.
- BubbleableMetadataTest::testCreateFromRenderArray in core/
tests/ Drupal/ Tests/ Core/ Render/ BubbleableMetadataTest.php - @covers ::createFromRenderArray @dataProvider providerTestCreateFromRenderArray
- EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext in core/
lib/ Drupal/ Core/ EventSubscriber/ EarlyRenderingControllerWrapperSubscriber.php - Wraps a controller execution in a render context.
- FormElementBase::processAutocomplete in core/
lib/ Drupal/ Core/ Render/ Element/ FormElementBase.php - Adds autocomplete functionality to elements.
- Link::preRenderLink in core/
lib/ Drupal/ Core/ Render/ Element/ Link.php - Pre-render callback: Renders a link into #markup.
File
- core/
lib/ Drupal/ Core/ Render/ BubbleableMetadata.php, line 65
Class
- BubbleableMetadata
- Value object used for bubbleable rendering metadata.
Namespace
Drupal\Core\RenderCode
public static function createFromRenderArray(array $build) {
$meta = parent::createFromRenderArray($build);
$meta->attachments = isset($build['#attached']) ? $build['#attached'] : [];
return $meta;
}