You are here

class TestRouteSubscriber in Devel 8

Same name and namespace in other branches
  1. 8.3 tests/modules/devel_test/src/Routing/TestRouteSubscriber.php \Drupal\devel_test\Routing\TestRouteSubscriber
  2. 8.2 tests/modules/devel_test/src/Routing/TestRouteSubscriber.php \Drupal\devel_test\Routing\TestRouteSubscriber
  3. 4.x tests/modules/devel_test/src/Routing/TestRouteSubscriber.php \Drupal\devel_test\Routing\TestRouteSubscriber

Router subscriber class for testing purpose.

Hierarchy

Expanded class hierarchy of TestRouteSubscriber

1 string reference to 'TestRouteSubscriber'
devel_test.services.yml in tests/modules/devel_test/devel_test.services.yml
tests/modules/devel_test/devel_test.services.yml
1 service uses TestRouteSubscriber
devel_test.test_route_subscriber in tests/modules/devel_test/devel_test.services.yml
Drupal\devel_test\Routing\TestRouteSubscriber

File

tests/modules/devel_test/src/Routing/TestRouteSubscriber.php, line 11

Namespace

Drupal\devel_test\Routing
View source
class TestRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    \Drupal::state()
      ->set('devel_test_route_rebuild', 'Router rebuild fired');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1
TestRouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes