You are here

public function Micon::getIconElement in Micon 8

Same name and namespace in other branches
  1. 2.x src/Plugin/SocialMediaLinks/Iconset/Micon.php \Drupal\micon\Plugin\SocialMediaLinks\Iconset\Micon::getIconElement()

Get the iconset element.

Parameters

string $platform: The platform id.

string $style: The style.

Return value

array The array with the icon element.

Overrides IconsetBase::getIconElement

File

src/Plugin/SocialMediaLinks/Iconset/Micon.php, line 39

Class

Micon
Provides 'elegantthemes' iconset.

Namespace

Drupal\micon\Plugin\SocialMediaLinks\Iconset

Code

public function getIconElement($platform, $style) {
  $icon_name = $platform
    ->getIconName();
  switch ($icon_name) {
    case 'vimeo':
      $icon_name = $icon_name . '-square';
      break;
    case 'googleplus':
      $icon_name = 'google-plus';
      break;
    case 'email':
      $icon_name = 'envelope';
      break;
  }
  $icon = array(
    '#theme' => 'micon',
    '#icon' => 'fa-' . $icon_name,
  );
  return $icon;
}