Services - 9.5.x - 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 905

Title File name Summary All service tags
redirect.destination core/core.services.yml Drupal\Core\Routing\RedirectDestination
redirect_leading_slashes_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RedirectLeadingSlashesSubscriber event_subscriber
redirect_response_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RedirectResponseSubscriber event_subscriber
renderer core/core.services.yml Drupal\Core\Render\Renderer
renderer_non_html core/core.services.yml Drupal\Core\EventSubscriber\RenderArrayNonHtmlSubscriber event_subscriber
render_cache core/core.services.yml Drupal\Core\Render\PlaceholderingRenderCache
render_placeholder_generator core/core.services.yml Drupal\Core\Render\PlaceholderGenerator
request_close_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RequestCloseSubscriber event_subscriber
request_format_route_filter core/core.services.yml Drupal\Core\Routing\RequestFormatRouteFilter route_filter
request_stack core/core.services.yml Drupal\Core\Http\RequestStack persist
required_module_uninstall_validator core/core.services.yml Drupal\Core\Extension\RequiredModuleUninstallValidator module_install.uninstall_validator
resolver_manager.entity core/core.services.yml Drupal\Core\Entity\EntityResolverManager
response_filter.active_link core/core.services.yml Drupal\Core\EventSubscriber\ActiveLinkResponseFilter event_subscriber
response_filter.rss.relative_url core/core.services.yml Drupal\Core\EventSubscriber\RssResponseRelativeUrlFilter event_subscriber
response_generator_subscriber core/core.services.yml Drupal\Core\EventSubscriber\ResponseGeneratorSubscriber event_subscriber
rest.resource.entity.post_route.subscriber core/modules/rest/rest.services.yml \Drupal\rest\EventSubscriber\EntityResourcePostRouteSubscriber event_subscriber
rest.resource_response.subscriber core/modules/rest/rest.services.yml Drupal\rest\EventSubscriber\ResourceResponseSubscriber event_subscriber
rest.resource_routes core/modules/rest/rest.services.yml Drupal\rest\Routing\ResourceRoutes event_subscriber
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.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 event_subscriber
router.request_context core/core.services.yml Drupal\Core\Routing\RequestContext persist
router.route_preloader core/core.services.yml Drupal\Core\Routing\RoutePreloader event_subscriber
router.route_provider core/core.services.yml Drupal\Core\Routing\RouteProvider event_subscriber, backend_overridable
router.route_provider.lazy_builder core/core.services.yml Drupal\Core\Routing\RouteProviderLazyBuilder event_subscriber
router_listener core/core.services.yml Symfony\Component\HttpKernel\EventListener\RouterListener event_subscriber
route_access_response_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RouteAccessResponseSubscriber event_subscriber
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, event_subscriber
route_http_method_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RouteMethodSubscriber event_subscriber
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 service_collector
route_special_attributes_subscriber core/core.services.yml Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber event_subscriber
route_subscriber.entity core/core.services.yml Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber event_subscriber
route_subscriber.module core/core.services.yml Drupal\Core\EventSubscriber\ModuleRouteSubscriber event_subscriber
route_subscriber.no_big_pipe core/modules/big_pipe/big_pipe.services.yml Drupal\big_pipe\EventSubscriber\NoBigPipeRouteAlterSubscriber event_subscriber
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

Other projects


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