Services - main - drupal

Primary tabs

Introduction to services

A "service" (such as accessing the database, sending email, or translating user interface text) can be defined by a module or Drupal core. Defining a service means giving it a name and designating a default class to provide the service; ideally, there should also be an interface that defines the methods that may be called. Services are collected into the Dependency Injection Container, and can be overridden to use different classes or different instantiation by modules. See the Services and Dependency Injection Container topic for details.

Some services have tags, which are defined in the service definition. Tags are used to define a group of related services, or to specify some aspect of how the service behaves. See the Service Tags topic for more information.

See also

Services and Dependency Injection Container

Service Tags

File

core/core.api.php, line 912

Title File name Summary All service tags
request_format_route_filter core/core.services.yml Drupal\Core\Routing\RequestFormatRouteFilter route_filter
request_stack core/core.services.yml Symfony\Component\HttpFoundation\RequestStack persist
required_module_uninstall_validator core/core.services.yml Drupal\Core\Extension\RequiredModuleUninstallValidator
resolver_manager.entity core/core.services.yml Drupal\Core\Entity\EntityResolverManager
response_filter.active_link core/core.services.yml Drupal\Core\EventSubscriber\ActiveLinkResponseFilter
response_filter.rss.relative_url core/core.services.yml Drupal\Core\EventSubscriber\RssResponseRelativeUrlFilter
response_generator_subscriber core/core.services.yml Drupal\Core\EventSubscriber\ResponseGeneratorSubscriber
rest.resource.entity.post_route.subscriber core/modules/rest/rest.services.yml \Drupal\rest\EventSubscriber\EntityResourcePostRouteSubscriber
rest.resource_response.subscriber core/modules/rest/rest.services.yml Drupal\rest\EventSubscriber\ResourceResponseSubscriber
rest.resource_routes core/modules/rest/rest.services.yml Drupal\rest\Routing\ResourceRoutes
rest_test.authentication.test_auth core/modules/rest/tests/modules/rest_test/rest_test.services.yml Drupal\rest_test\Authentication\Provider\TestAuth authentication_provider
rest_test.authentication.test_auth_global core/modules/rest/tests/modules/rest_test/rest_test.services.yml Drupal\rest_test\Authentication\Provider\TestAuthGlobal authentication_provider
rest_test.encoder.foobar core/modules/rest/tests/modules/rest_test/rest_test.services.yml Drupal\serialization\Encoder\JsonEncoder encoder
rest_test.page_cache_request_policy.deny_test_auth_requests core/modules/rest/tests/modules/rest_test/rest_test.services.yml Drupal\rest_test\PageCache\RequestPolicy\DenyTestAuthRequests page_cache_request_policy
router core/core.services.yml Drupal\Core\Routing\AccessAwareRouter
router.admin_context core/core.services.yml Drupal\Core\Routing\AdminContext
router.builder core/core.services.yml Drupal\Core\Routing\RouteBuilder needs_destruction
router.builder.attributes core/core.services.yml Drupal\Core\Routing\AttributeRouteDiscovery
router.builder.yaml core/core.services.yml Drupal\Core\Routing\YamlRouteDiscovery
router.dumper core/core.services.yml Drupal\Core\Routing\MatcherDumper backend_overridable
router.no_access_checks core/core.services.yml \Drupal\Core\Routing\Router service_collector
router.path_roots_subscriber core/core.services.yml Drupal\Core\EventSubscriber\PathRootsSubscriber
router.request_context core/core.services.yml Drupal\Core\Routing\RequestContext persist
router.route_provider core/core.services.yml Drupal\Core\Routing\RouteProvider backend_overridable
router.route_provider.lazy_builder core/core.services.yml Drupal\Core\Routing\RouteProviderLazyBuilder
router.yaml_cache_collector core/core.services.yml Drupal\Core\Utility\YamlCacheCollector
router_listener core/core.services.yml Drupal\Core\Http\EventListener\RouterListener
route_access_response_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RouteAccessResponseSubscriber
route_enhancer.entity core/core.services.yml Drupal\Core\Entity\Enhancer\EntityRouteEnhancer route_enhancer
route_enhancer.entity_bundle core/core.services.yml Drupal\Core\Entity\Enhancer\EntityBundleRouteEnhancer route_enhancer
route_enhancer.entity_revision core/core.services.yml Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer route_enhancer
route_enhancer.form core/core.services.yml Drupal\Core\Routing\Enhancer\FormRouteEnhancer route_enhancer
route_enhancer.param_conversion core/core.services.yml Drupal\Core\Routing\Enhancer\ParamConversionEnhancer route_enhancer
route_http_method_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RouteMethodSubscriber
route_processor_csrf core/core.services.yml Drupal\Core\Access\RouteProcessorCsrf route_processor_outbound
route_processor_current core/core.services.yml Drupal\Core\RouteProcessor\RouteProcessorCurrent route_processor_outbound
route_processor_manager core/core.services.yml Drupal\Core\RouteProcessor\RouteProcessorManager
route_special_attributes_subscriber core/core.services.yml Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber
route_subscriber.entity core/core.services.yml Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber
route_subscriber.module core/core.services.yml Drupal\Core\EventSubscriber\ModuleRouteSubscriber
route_subscriber.no_big_pipe core/modules/big_pipe/big_pipe.services.yml Drupal\big_pipe\EventSubscriber\NoBigPipeRouteAlterSubscriber
sdc_other_node_visitor.twig.extension.profiler core/modules/system/tests/modules/sdc_other_node_visitor/sdc_other_node_visitor.services.yml Drupal\sdc_other_node_visitor\Twig\Extension\TestProfilerExtension twig.extension
search.index core/modules/search/search.services.yml Drupal\search\SearchIndex backend_overridable
search.search_page_repository core/modules/search/search.services.yml Drupal\search\SearchPageRepository
search.text_processor core/modules/search/search.services.yml Drupal\search\SearchTextProcessor
serialization.entity_resolver.target_id core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\TargetIdResolver entity_resolver
serialization.exception.default core/modules/serialization/serialization.services.yml Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber
serialization.json core/core.services.yml Drupal\Component\Serialization\Json
serialization.normalizer.field core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\FieldNormalizer normalizer
serialization.normalizer.field_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\FieldItemNormalizer normalizer

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.