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

Name File Classsort descending Tags
Drupal\Core\Http\HandlerStackConfigurator core/core.services.yml
logger.channel.ckeditor5 core/modules/ckeditor5/ckeditor5.services.yml
Drupal\block\BlockRepositoryInterface core/modules/block/block.services.yml
logger.channel.jsonapi core/modules/jsonapi/jsonapi.services.yml
GuzzleHttp\ClientInterface core/core.services.yml
Psr\Http\Client\ClientInterface core/core.services.yml
_defaults core/modules/block_content/block_content.services.yml
_defaults core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml f, bar.tag2, bar.tag3
Drupal\book\BookManagerInterface core/modules/book/book.services.yml
Drupal\Core\Http\ClientFactory core/core.services.yml
Drupal\services_defaults_test\TestInjectionInterface core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\Core\StreamWrapper\AssetsStream core/core.services.yml
Drupal\book\BookOutline core/modules/book/book.services.yml
Drupal\services_defaults_test\TestInjection core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\book\BookExport core/modules/book/book.services.yml
Drupal\services_defaults_test\TestInjection2 core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml z, bar.tag2
Drupal\book\BookOutlineStorageInterface core/modules/book/book.services.yml
Drupal\Core\Theme\ThemeNegotiatorInterface core/core.services.yml
Drupal\Core\Site\MaintenanceModeInterface core/core.services.yml
Drupal\services_defaults_test\TestService core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\breakpoint\BreakpointManagerInterface core/modules/breakpoint/breakpoint.services.yml
Drupal\services_defaults_test\TestPrivateService core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
_defaults core/modules/ckeditor5/ckeditor5.services.yml
Drupal\ckeditor5\Plugin\CKEditor5PluginManagerInterface core/modules/ckeditor5/ckeditor5.services.yml
Drupal\ckeditor5\SmartDefaultSettings core/modules/ckeditor5/ckeditor5.services.yml
Drupal\Core\Database\EventSubscriber\StatementExecutionSubscriber core/core.services.yml
Drupal\ckeditor5\CKEditor5StylesheetsMessage core/modules/ckeditor5/ckeditor5.services.yml
Drupal\Core\Extension\ModuleHandlerInterface core/core.services.yml
Drupal\Core\Extension\ModuleInstallerInterface core/core.services.yml
Drupal\comment\CommentManagerInterface core/modules/comment/comment.services.yml
Drupal\comment\CommentStatisticsInterface core/modules/comment/comment.services.yml
Drupal\Core\Extension\ModuleExtensionList core/core.services.yml
Drupal\comment\CommentLazyBuilders core/modules/comment/comment.services.yml
Drupal\database_test\EventSubscriber\DatabaseEventSubscriber core/modules/system/tests/modules/database_test/database_test.services.yml
Drupal\comment\CommentLinkBuilderInterface core/modules/comment/comment.services.yml
Drupal\Core\Extension\ProfileExtensionList core/core.services.yml
Drupal\Core\EventSubscriber\CsrfExceptionSubscriber core/core.services.yml
_defaults core/modules/config/config.services.yml
_defaults core/modules/config_translation/config_translation.services.yml
Drupal\Core\Extension\ThemeExtensionList core/core.services.yml
Drupal\config_translation\ConfigMapperManagerInterface core/modules/config_translation/config_translation.services.yml
Drupal\contact\MailHandlerInterface core/modules/contact/contact.services.yml
Drupal\Core\Extension\ThemeEngineExtensionList core/core.services.yml
_defaults core/modules/content_moderation/content_moderation.services.yml
Drupal\content_moderation\StateTransitionValidationInterface core/modules/content_moderation/content_moderation.services.yml
Drupal\Core\Extension\ExtensionPathResolver core/core.services.yml
Drupal\content_moderation\ModerationInformationInterface core/modules/content_moderation/content_moderation.services.yml
_defaults core/modules/content_translation/content_translation.services.yml
Drupal\content_translation\FieldTranslationSynchronizerInterface core/modules/content_translation/content_translation.services.yml
Drupal\content_translation\ContentTranslationManagerInterface core/modules/content_translation/content_translation.services.yml

Pages

Other projects