function IconDefinition::getIconDataFromId

Overrides IconDefinitionInterface::getIconDataFromId

2 calls to IconDefinition::getIconDataFromId()
IconCollector::getIconFromExtractor in core/lib/Drupal/Core/Theme/Icon/IconCollector.php
Returns the icon from an icon id and icon pack definition.
IconDefinition::getRenderable in core/lib/Drupal/Core/Theme/Icon/IconDefinition.php
Get the icon renderable element array.

File

core/lib/Drupal/Core/Theme/Icon/IconDefinition.php, line 88

Class

IconDefinition
Handle an icon definition.

Namespace

Drupal\Core\Theme\Icon

Code

public static function getIconDataFromId(string $icon_full_id) : ?array {
    $icon_data = explode(self::ICON_SEPARATOR, $icon_full_id, 2);
    if (count($icon_data) < 2) {
        return NULL;
    }
    return [
        'pack_id' => $icon_data[0],
        'icon_id' => $icon_data[1],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.