RoutingEvents.php 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9
<?php

namespace Drupal\Core\Routing;

/**
 * Contains all events thrown in the core routing component.
 */
final class RoutingEvents {

10
  /**
11
   * Name of the event fired during route collection to allow new routes.
12
   *
13 14 15 16 17 18 19 20 21 22 23 24
   * This event is used to add new routes based upon existing routes, giving
   * modules the opportunity to dynamically generate additional routes. The
   * event listener method receives a \Drupal\Core\Routing\RouteBuildEvent
   * instance.
   *
   * @Event
   *
   * @see \Drupal\Core\Routing\RouteBuildEvent
   * @see \Drupal\Core\EventSubscriber\EntityRouteProviderSubscriber
   * @see \Drupal\Core\Routing\RouteBuilder::rebuild()
   *
   * @var string
25 26 27
   */
  const DYNAMIC = 'routing.route_dynamic';

28
  /**
29 30 31 32 33 34 35 36
   * Name of the event fired during route collection to allow changes to routes.
   *
   * This event is used to process new routes before they get saved, giving
   * modules the opportunity to alter routes provided by any other module. The
   * event listener method receives a \Drupal\Core\Routing\RouteBuildEvent
   * instance.
   *
   * @Event
37
   *
38 39 40 41 42
   * @see \Symfony\Component\Routing\RouteCollection
   * @see \Drupal\system\EventSubscriber\AdminRouteSubscriber
   * @see \Drupal\Core\Routing\RouteBuilder::rebuild()
   *
   * @var string
43 44 45
   */
  const ALTER = 'routing.route_alter';

46
  /**
47 48 49 50 51 52 53 54 55 56 57 58 59
   * Name of the event fired to indicate route building has ended.
   *
   * This event gives modules the opportunity to perform some action after route
   * building has completed. The event listener receives a
   * \Symfony\Component\EventDispatcher\Event instance.
   *
   * @Event
   *
   * @see \Symfony\Component\EventDispatcher\Event
   * @see \Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber
   * @see \Drupal\Core\Routing\RouteBuilder::rebuild()
   *
   * @var string
60 61 62
   */
  const FINISHED = 'routing.route_finished';

63
}