3 * Contains \Drupal\{{ module }}\Routing\RouteSubscriber.
6 namespace Drupal\{{ module }}\Routing;
8 use Drupal\Core\Routing\RouteSubscriberBase;
9 use Symfony\Component\Routing\RouteCollection;
12 * Listens to dynamic route events.
14 class RouteSubscriber extends RouteSubscriberBase {
19 public function alterRoutes(RouteCollection $collection) {
22 * Parts of your hook_menu_alter() logic should be moved in here. You should NOT
23 * use this method to define new routes -- read the documentation at
24 * https://www.drupal.org/node/2122201 to learn how to define dynamic routes --
25 * but to alter existing ones.