Services - 11.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 900

Title File name Summary All service tags
system.module_admin_links_memory_cache core/modules/system/system.services.yml Drupal\Core\Cache\MemoryCache\MemoryCache
system.sa_fetcher core/modules/system/system.services.yml Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher
system.timezone_resolver core/modules/system/system.services.yml Drupal\system\TimeZoneResolver
taxonomy_term.breadcrumb core/modules/taxonomy/taxonomy.services.yml Drupal\taxonomy\TermBreadcrumbBuilder breadcrumb_builder
taxonomy_term.taxonomy_term_route_context core/modules/taxonomy/taxonomy.services.yml Drupal\taxonomy\ContextProvider\TermRouteContext context_provider
test_domain_object.view_subscriber core/modules/system/tests/modules/early_rendering_controller_test/early_rendering_controller_test.services.yml Drupal\early_rendering_controller_test\TestDomainObjectViewSubscriber
test_service core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestService
test_service2 core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestService
test_service2_decorator core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestServiceDecorator
test_service2_decorator2 core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestServiceDecorator
test_service_decorator core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestServiceDecorator
theme.negotiator.admin_theme core/modules/user/user.services.yml Drupal\user\Theme\AdminNegotiator theme_negotiator
theme.negotiator.block.admin_demo core/modules/block/block.services.yml Drupal\block\Theme\AdminDemoNegotiator theme_negotiator
theme.negotiator.high_priority core/modules/system/tests/modules/theme_test/theme_test.services.yml Drupal\theme_test\Theme\HighPriorityThemeNegotiator theme_negotiator
theme.negotiator.system.batch core/modules/system/system.services.yml Drupal\system\Theme\BatchNegotiator theme_negotiator
theme.negotiator.system.db_update core/modules/system/system.services.yml Drupal\system\Theme\DbUpdateNegotiator theme_negotiator
theme.negotiator.test_custom_theme core/modules/system/tests/modules/theme_test/theme_test.services.yml Drupal\theme_test\Theme\CustomThemeNegotiator theme_negotiator
theme.negotiator.test_theme core/modules/system/tests/modules/menu_test/menu_test.services.yml Drupal\menu_test\Theme\TestThemeNegotiator theme_negotiator
theme_test.subscriber core/modules/system/tests/modules/theme_test/theme_test.services.yml Drupal\theme_test\EventSubscriber\ThemeTestSubscriber
toolbar.menu_tree core/modules/toolbar/toolbar.services.yml Drupal\toolbar\Menu\ToolbarMenuLinkTree
toolbar.page_cache_request_policy.allow_toolbar_path core/modules/toolbar/toolbar.services.yml Drupal\toolbar\PageCache\AllowToolbarPath page_cache_request_policy
twig_extension_test.twig.test_extension core/modules/system/tests/modules/twig_extension_test/twig_extension_test.services.yml Drupal\twig_extension_test\TwigExtension\TestExtension twig.extension
twig_loader_test.twig.test_loader core/modules/system/tests/modules/twig_loader_test/twig_loader_test.services.yml Drupal\twig_loader_test\Loader\TestLoader twig.loader
update.fetcher core/modules/update/update.services.yml Drupal\update\UpdateFetcher
update.manager core/modules/update/update.services.yml Drupal\update\UpdateManager
update.processor core/modules/update/update.services.yml Drupal\update\UpdateProcessor
update.root core/modules/update/update.services.yml Drupal\update\UpdateRoot
update.route_subscriber core/modules/update/update.services.yml Drupal\update\Routing\UpdateRouteSubscriber
update_script_test.broken_path_processor core/modules/system/tests/modules/update_script_test/update_script_test.services.yml Drupal\update_script_test\PathProcessor\BrokenInboundPathProcessor path_processor_inbound
url_alter_test.path_processor core/modules/system/tests/modules/url_alter_test/url_alter_test.services.yml Drupal\url_alter_test\PathProcessorTest path_processor_inbound, path_processor_outbound
user.auth core/modules/user/user.services.yml Drupal\user\UserAuthentication
user.authentication.cookie core/modules/user/user.services.yml Drupal\user\Authentication\Provider\Cookie authentication_provider
user.current_user_context core/modules/user/user.services.yml Drupal\user\ContextProvider\CurrentUserContext context_provider
user.data core/modules/user/user.services.yml Drupal\user\UserData backend_overridable
user.flood_control core/modules/user/user.services.yml Drupal\user\UserFloodControl
user.flood_subscriber core/modules/user/user.services.yml Drupal\user\EventSubscriber\UserFloodSubscriber
user.module_permissions_link_helper core/modules/user/user.services.yml Drupal\user\ModulePermissionsLinkHelper
user.name_validator core/modules/user/user.services.yml Drupal\user\UserNameValidator
user.permissions core/modules/user/user.services.yml Drupal\user\PermissionHandler
user.toolbar_link_builder core/modules/user/user.services.yml Drupal\user\ToolbarLinkBuilder
user_access_denied_subscriber core/modules/user/user.services.yml Drupal\user\EventSubscriber\AccessDeniedSubscriber
user_auth_decorator.user.auth core/modules/user/tests/modules/user_auth_decorator_test/user_auth_decorator_test.services.yml \Drupal\user_auth_decorator_test\UserAuthDecorator
user_last_access_subscriber core/modules/user/user.services.yml Drupal\user\EventSubscriber\UserRequestSubscriber
user_maintenance_mode_subscriber core/modules/user/user.services.yml Drupal\user\EventSubscriber\MaintenanceModeSubscriber
variation_cache.dynamic_page_cache core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\Core\Cache\VariationCacheInterface
variation_cache.jsonapi_normalizations core/modules/jsonapi/jsonapi.services.yml Drupal\Core\Cache\VariationCacheInterface
views.analyzer core/modules/views/views.services.yml Drupal\views\Analyzer
views.cast_sql core/modules/views/views.services.yml Drupal\views\Plugin\views\query\CastSql backend_overridable
views.date_sql core/modules/views/views.services.yml Drupal\views\Plugin\views\query\MysqlDateSql backend_overridable
views.entity_schema_subscriber core/modules/views/views.services.yml Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber

Other projects


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