function IconDefinitionInterface::getRenderable

Get the icon renderable element array.

Shortcut to use icon element quickly without check if the icon id is valid, then the element will simply be empty.

Parameters

string $icon_full_id: The id of the icon including the pack.

array $settings: Settings to pass to the renderable for context. Can be indexed by the icon pack id for lookup.

Return value

array|null The icon renderable.

1 method overrides IconDefinitionInterface::getRenderable()
IconDefinition::getRenderable in core/lib/Drupal/Core/Theme/Icon/IconDefinition.php

File

core/lib/Drupal/Core/Theme/Icon/IconDefinitionInterface.php, line 85

Class

IconDefinitionInterface
Interface for icon definition.

Namespace

Drupal\Core\Theme\Icon

Code

public static function getRenderable(string $icon_full_id, array $settings = []) : ?array;

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