function hook_event_dispatcher_path_update in Hook Event Dispatcher 8
Implements hook_path_update().
2 calls to hook_event_dispatcher_path_update()
- PathEventTest::testPathUpdateEvent in tests/
src/ Unit/ Path/ PathEventTest.php - Test PathUpdateEvent.
- PathEventTest::testWithEmptyPath in tests/
src/ Unit/ Path/ PathEventTest.php - Test with empty path array.
File
- ./
hook_event_dispatcher.module, line 402 - Hook event dispatcher module.
Code
function hook_event_dispatcher_path_update($path) {
if (empty($path)) {
return;
}
/** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
$manager = \Drupal::service('hook_event_dispatcher.manager');
$event = new PathUpdateEvent($path);
$manager
->register($event);
}