public static BubbleableMetadata::createFromRenderArray(array $build)
Creates a bubbleable metadata object with values taken from a render array.
Parameters
array $build: A render array.
Return value
static
Overrides CacheableMetadata::createFromRenderArray
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; }
Please login to continue.