toolbar_event_dispatcher.module in Hook Event Dispatcher 3.x
Same filename and directory in other branches
Toolbar event dispatcher submodule.
File
modules/toolbar_event_dispatcher/toolbar_event_dispatcher.moduleView source
<?php
/**
* @file
* Toolbar event dispatcher submodule.
*/
use Drupal\toolbar_event_dispatcher\Event\Toolbar\ToolbarAlterEvent;
use Drupal\toolbar_event_dispatcher\Event\Toolbar\ToolbarEvent;
/**
* Implements hook_toolbar_alter().
*
* {@inheritdoc}
*/
function toolbar_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);
}
/**
* Implements hook_toolbar().
*
* {@inheritdoc}
*/
function toolbar_event_dispatcher_toolbar() {
/** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
$manager = Drupal::service('hook_event_dispatcher.manager');
$event = new ToolbarEvent();
$manager
->register($event);
}
Functions
Name | Description |
---|---|
toolbar_event_dispatcher_toolbar | Implements hook_toolbar(). |
toolbar_event_dispatcher_toolbar_alter | Implements hook_toolbar_alter(). |