You are here

public static function AMPService::libraryDescription in Accelerated Mobile Pages (AMP) 8.3

LibraryDescription.

Parameters

array $libraries: Array of AMP libraries to get info for.

Return value

array Links to information about the AMP components used by the libraries.

File

src/Service/AMPService.php, line 233

Class

AMPService
Class AMPService.

Namespace

Drupal\amp\Service

Code

public static function libraryDescription($libraries) {
  $info = [];
  $library_info = static::libraryInfo($libraries);
  foreach ($library_info as $name => $library_item) {
    $name = ucfirst(str_replace('amp.', '', $name));
    $url = $library_item['remote'];
    $info[] = t('<a href=":url" target="_blank">AMP :name</a>', [
      ':name' => $name,
      ':url' => $url,
    ]);
  }
  return t('For more information about this AMP component, see') . ' ' . implode(', ', $info);
}