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
Drupal\serialization\EntityResolver\ChainEntityResolverInterface core/modules/serialization/serialization.services.yml
Drupal\services_defaults_test\TestInjection core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\services_defaults_test\TestInjection2 core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml zee.bang, bar.tag2
Drupal\services_defaults_test\TestInjectionInterface core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\services_defaults_test\TestPrivateService core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\services_defaults_test\TestService core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\shortcut\ShortcutLazyBuilders core/modules/shortcut/shortcut.services.yml
Drupal\statistics\StatisticsStorageInterface core/modules/statistics/statistics.services.yml
Drupal\system\ModuleAdminLinksHelper core/modules/system/system.services.yml
Drupal\system\Routing\MenuLinksetRoutes core/modules/system/system.services.yml
Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher core/modules/system/system.services.yml
Drupal\system\SystemManager core/modules/system/system.services.yml
Drupal\update\UpdateFetcherInterface core/modules/update/update.services.yml
Drupal\update\UpdateManagerInterface core/modules/update/update.services.yml
Drupal\update\UpdateProcessorInterface core/modules/update/update.services.yml
Drupal\user\ModulePermissionsLinkHelper core/modules/user/user.services.yml
Drupal\user\PermissionHandlerInterface core/modules/user/user.services.yml
Drupal\user\ToolbarLinkBuilder core/modules/user/user.services.yml
Drupal\user\UserAuthInterface core/modules/user/user.services.yml
Drupal\user\UserDataInterface core/modules/user/user.services.yml
Drupal\user\UserFloodControlInterface core/modules/user/user.services.yml
Drupal\user\UserNameValidator core/modules/user/user.services.yml
Drupal\user_route_alter_test\Routing\RouteSubscriber core/modules/serialization/tests/modules/user_route_alter_test/user_route_alter_test.services.yml
Drupal\views\Analyzer core/modules/views/views.services.yml
Drupal\views\ExposedFormCache core/modules/views/views.services.yml
Drupal\views\ViewExecutableFactory core/modules/views/views.services.yml
Drupal\views\ViewsData core/modules/views/views.services.yml
Drupal\views\ViewsDataHelper core/modules/views/views.services.yml
Drupal\workspaces\Controller\WorkspacesHtmlEntityFormController core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspaceAssociationInterface core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspaceInformationInterface core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspaceManagerInterface core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspaceOperationFactory core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspaceRepositoryInterface core/modules/workspaces/workspaces.services.yml
Drupal\workspaces\WorkspacesLazyBuilders core/modules/workspaces/workspaces.services.yml
dynamic_page_cache_deny_admin_routes core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\dynamic_page_cache\PageCache\ResponsePolicy\DenyAdminRoutes dynamic_page_cache_response_policy
dynamic_page_cache_request_policy core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\dynamic_page_cache\PageCache\RequestPolicy\DefaultRequestPolicy service_collector
dynamic_page_cache_response_policy core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\Core\PageCache\ChainResponsePolicy service_collector
dynamic_page_cache_subscriber core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber
early_translation_test.authentication.early_translation_test core/modules/locale/tests/modules/early_translation_test/early_translation_test.services.yml Drupal\early_translation_test\Auth authentication_provider
editor.config_translation_mapper_subscriber core/modules/editor/editor.services.yml Drupal\editor\EventSubscriber\EditorConfigTranslationSubscriber
element.editor core/modules/editor/editor.services.yml Drupal\editor\Element
entity_test.definition.subscriber core/modules/system/tests/modules/entity_test/entity_test.services.yml Drupal\entity_test\EntityTestDefinitionSubscriber
entity_test_update.entity_schema_listener core/modules/system/tests/modules/entity_test_update/entity_test_update.services.yml Drupal\entity_test_update\EventSubscriber\EntitySchemaSubscriber
field.uninstall_validator core/modules/field/field.services.yml Drupal\field\FieldUninstallValidator
field_ui.subscriber core/modules/field_ui/field_ui.services.yml Drupal\field_ui\Routing\RouteSubscriber
file.event.subscriber core/modules/file/file.services.yml Drupal\file\EventSubscriber\FileEventSubscriber
file.input_stream_file_writer core/modules/file/file.services.yml Drupal\file\Upload\InputStreamFileWriter
file.recursive_validator core/modules/file/file.services.yml Symfony\Component\Validator\Validator\ValidatorInterface
file.recursive_validator_factory core/modules/file/file.services.yml Drupal\file\Validation\RecursiveValidatorFactory

Other projects


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