You are here

function hook_event_dispatcher_toolbar_alter in Hook Event Dispatcher 8

Implements hook_toolbar_alter().

2 calls to hook_event_dispatcher_toolbar_alter()
ToolbarAlterEventTest::testToolbarAlterEventByReference in tests/src/Unit/Toolbar/ToolbarAlterEventTest.php
Test the ToolbarAlterEvent by reference.
ToolbarAlterEventTest::testToolbarAlterEventBySet in tests/src/Unit/Toolbar/ToolbarAlterEventTest.php
Test the ToolbarAlterEvent by reference.

File

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

Code

function hook_event_dispatcher_toolbar_alter(array &$items) {

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