class HeaderAssetsTestHooks

Hook implementations for header_assets_test.

Hierarchy

Expanded class hierarchy of HeaderAssetsTestHooks

File

core/modules/system/tests/modules/header_assets_test/src/Hook/HeaderAssetsTestHooks.php, line 12

Namespace

Drupal\header_assets_test\Hook
View source
class HeaderAssetsTestHooks {
  
  /**
   * Implements hook_page_attachments().
   */
  public function pageAttachments(array &$attachments) : void {
    // Attach a header library so that its dependencies, which are not header
    // libraries themselves, are loaded in the header on every page.
    $attachments['#attached']['library'][] = 'header_assets_test/header';
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.