You are here

public static function Pattern::processLibraries in UI Patterns 8

Process libraries.

Parameters

array $element: Render array.

Return value

array Render array.

File

src/Element/Pattern.php, line 68

Class

Pattern
Renders a pattern element.

Namespace

Drupal\ui_patterns\Element

Code

public static function processLibraries(array $element) {
  foreach (UiPatterns::getPatternDefinition($element['#id'])
    ->getLibrariesNames() as $library) {
    $element['#attached']['library'][] = $library;
  }
  return $element;
}