You are here

function hook_event_dispatcher_page_attachments in Hook Event Dispatcher 8

Implements hook_page_attachments().

2 calls to hook_event_dispatcher_page_attachments()
PageAttachmentsEventTest::testPageAttachmentsByReference in tests/src/Unit/Page/PageAttachmentsEventTest.php
Test the PageAttachmentsEvent by reference.
PageAttachmentsEventTest::testPageAttachmentsBySet in tests/src/Unit/Page/PageAttachmentsEventTest.php
Test the PageAttachmentsEvent by set.

File

./hook_event_dispatcher.module, line 834
Hook event dispatcher module.

Code

function hook_event_dispatcher_page_attachments(array &$attachments) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = \Drupal::service('hook_event_dispatcher.manager');
  $event = new PageAttachmentsEvent($attachments);
  $manager
    ->register($event);
}