public function IconsetBase::getIconElement in Social Media Links Block and Field 8.2
Get the iconset element.
Parameters
string $platform: The platform id.
string $style: The style.
Return value
array The array with the icon element.
1 method overrides IconsetBase::getIconElement()
- FontAwesome::getIconElement in src/
Plugin/ SocialMediaLinks/ Iconset/ FontAwesome.php - Get the iconset element.
File
- src/
IconsetBase.php, line 117
Class
- IconsetBase
- Base class for iconset.
Namespace
Drupal\social_media_linksCode
public function getIconElement($platform, $style) {
$iconName = $platform
->getIconName();
$path = $this
->getIconPath($iconName, $style);
$icon = [
'#theme' => 'image',
'#uri' => $path,
];
return $icon;
}