RoutingEvents.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Drupal\Core\Routing;
  3. /**
  4. * Contains all events thrown in the core routing component.
  5. */
  6. final class RoutingEvents {
  7. /**
  8. * Name of the event fired during route collection to allow new routes.
  9. *
  10. * This event is used to add new routes based upon existing routes, giving
  11. * modules the opportunity to dynamically generate additional routes. The
  12. * event listener method receives a \Drupal\Core\Routing\RouteBuildEvent
  13. * instance.
  14. *
  15. * @Event
  16. *
  17. * @see \Drupal\Core\Routing\RouteBuildEvent
  18. * @see \Drupal\Core\EventSubscriber\EntityRouteProviderSubscriber
  19. * @see \Drupal\Core\Routing\RouteBuilder::rebuild()
  20. *
  21. * @var string
  22. */
  23. const DYNAMIC = 'routing.route_dynamic';
  24. /**
  25. * Name of the event fired during route collection to allow changes to routes.
  26. *
  27. * This event is used to process new routes before they get saved, giving
  28. * modules the opportunity to alter routes provided by any other module. The
  29. * event listener method receives a \Drupal\Core\Routing\RouteBuildEvent
  30. * instance.
  31. *
  32. * @Event
  33. *
  34. * @see \Symfony\Component\Routing\RouteCollection
  35. * @see \Drupal\system\EventSubscriber\AdminRouteSubscriber
  36. * @see \Drupal\Core\Routing\RouteBuilder::rebuild()
  37. *
  38. * @var string
  39. */
  40. const ALTER = 'routing.route_alter';
  41. /**
  42. * Name of the event fired to indicate route building has ended.
  43. *
  44. * This event gives modules the opportunity to perform some action after route
  45. * building has completed. The event listener receives a
  46. * \Symfony\Component\EventDispatcher\Event instance.
  47. *
  48. * @Event
  49. *
  50. * @see \Symfony\Component\EventDispatcher\Event
  51. * @see \Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber
  52. * @see \Drupal\Core\Routing\RouteBuilder::rebuild()
  53. *
  54. * @var string
  55. */
  56. const FINISHED = 'routing.route_finished';
  57. }