You are here

public function UiPatternsSourceManager::getDefinitionsByTag in UI Patterns 8

Filter definitions by given tag.

Parameters

string $tag: Tag used on plugin annotation.

Return value

array List of definitions tagged with given tag.

1 call to UiPatternsSourceManager::getDefinitionsByTag()
UiPatternsSourceManager::getFieldsByTag in src/UiPatternsSourceManager.php
Get field source definitions by specified tags.

File

src/UiPatternsSourceManager.php, line 32

Class

UiPatternsSourceManager
Provides the UI Patterns Source plugin manager.

Namespace

Drupal\ui_patterns

Code

public function getDefinitionsByTag($tag) {
  return array_filter($this
    ->getDefinitions(), function ($definition) use ($tag) {
    return in_array($tag, $definition['tags']);
  });
}