You are here

public function RouterTestServiceProvider::register in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/router_test_directory/src/RouterTestServiceProvider.php \Drupal\router_test\RouterTestServiceProvider::register()

Registers services to the container.

Parameters

ContainerBuilder $container: The ContainerBuilder to register services to.

Overrides ServiceProviderInterface::register

File

core/modules/system/tests/modules/router_test_directory/src/RouterTestServiceProvider.php, line 16

Class

RouterTestServiceProvider
Registers a dynamic route provider.

Namespace

Drupal\router_test

Code

public function register(ContainerBuilder $container) {
  $container
    ->register('router_test.subscriber', 'Drupal\\router_test\\RouteTestSubscriber')
    ->addTag('event_subscriber');
  $container
    ->register('access_check.router_test', 'Drupal\\router_test\\Access\\TestAccessCheck')
    ->addTag('access_check', [
    'applies_to' => '_access_router_test',
  ]);
}