You are here

public function Micon::getIconElement in Micon 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/SocialMediaLinks/Iconset/Micon.php \Drupal\micon\Plugin\SocialMediaLinks\Iconset\Micon::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 = [
    '#theme' => 'micon',
    '#icon' => 'fa-' . $icon_name,
  ];
  return $icon;
}