You are here

public function LinkIconManager::libraryInfoBuild in Link Icon 8

Implements hook_library_info_build().

File

src/LinkIconManager.php, line 77

Class

LinkIconManager
Provides LinkIconManager service.

Namespace

Drupal\linkicon

Code

public function libraryInfoBuild() {
  $libraries = [];
  if ($font_path = $this
    ->getSetting('font')) {
    if (strpos($font_path, ',') !== FALSE) {
      $paths = array_map('trim', explode(',', $font_path));
      foreach ($paths as $path) {
        $library_path[$path] = [];
      }
    }
    else {
      $library_path = [
        $font_path => [],
      ];
    }
    $libraries['linkicon.font'] = [
      'css' => [
        'base' => $library_path,
      ],
    ];
  }
  return $libraries;
}