Services - 10.3.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
jsonapi.version_negotiator.rel core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Revisions\VersionByRel jsonapi_version_negotiator
jsonapi_test_normalizers_kernel.jsonapi_document_toplevel core/modules/jsonapi/tests/modules/jsonapi_test_normalizers_kernel/jsonapi_test_normalizers_kernel.services.yml Alias of serializer.normalizer.jsonapi_document_toplevel.jsonapi
jsonapi_test_resource_type_building.build_subscriber core/modules/jsonapi/tests/modules/jsonapi_test_resource_type_building/jsonapi_test_resource_type_building.services.yml Drupal\jsonapi_test_resource_type_building\EventSubscriber\ResourceTypeBuildEventSubscriber
keyvalue core/core.services.yml Drupal\Core\KeyValueStore\KeyValueFactory
keyvalue.database core/core.services.yml Drupal\Core\KeyValueStore\KeyValueDatabaseFactory
keyvalue.expirable core/core.services.yml Drupal\Core\KeyValueStore\KeyValueExpirableFactory
keyvalue.expirable.database core/core.services.yml Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory
language.config_factory_override core/modules/language/language.services.yml Drupal\language\Config\LanguageConfigFactoryOverride config.factory.override
language.config_subscriber core/modules/language/language.services.yml Drupal\language\EventSubscriber\ConfigSubscriber
language.current_language_context core/core.services.yml Drupal\Core\Language\ContextProvider\CurrentLanguageContext context_provider
language.default core/core.services.yml Drupal\Core\Language\LanguageDefault
language_converter core/modules/language/language.services.yml Drupal\language\LanguageConverter paramconverter
language_events_test.event_subscriber core/modules/language/tests/language_events_test/language_events_test.services.yml Drupal\language_events_test\EventSubscriber event_subscriber
language_manager core/core.services.yml Drupal\Core\Language\LanguageManager
language_negotiator core/modules/language/language.services.yml Drupal\language\LanguageNegotiator
layout.icon_builder core/modules/layout_discovery/layout_discovery.services.yml Drupal\Core\Layout\Icon\SvgIconBuilder
layout_builder.controller.entity_form core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController
layout_builder.element.prepare_layout core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\EventSubscriber\PrepareLayout
layout_builder.extra_fields.invalidator core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Cache\ExtraFieldBlockCacheTagInvalidator cache_tags_invalidator
layout_builder.param_converter core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Routing\LayoutSectionStorageParamConverter paramconverter
layout_builder.render_block_component_subscriber core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray
layout_builder.routes core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Routing\LayoutBuilderRoutes
layout_builder.sample_entity_generator core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Entity\LayoutBuilderSampleEntityGenerator
layout_builder.tempstore.route_enhancer core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Routing\LayoutTempstoreRouteEnhancer route_enhancer
layout_builder.tempstore_repository core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\LayoutTempstoreRepository
layout_builder_decoration_test.controller.entity_form core/modules/layout_builder/tests/modules/layout_builder_decoration_test/layout_builder_decoration_test.services.yml Drupal\layout_builder_decoration_test\Controller\LayoutBuilderDecorationTestHtmlEntityFormController
layout_builder_element_test.prepare_layout core/modules/layout_builder/tests/modules/layout_builder_element_test/layout_builder_element_test.services.yml Drupal\layout_builder_element_test\EventSubscriber\TestPrepareLayout
layout_builder_fieldblock_test.fake_view_mode_context core/modules/layout_builder/tests/modules/layout_builder_fieldblock_test/layout_builder_fieldblock_test.services.yml Drupal\layout_builder_fieldblock_test\ContextProvider\FakeViewModeContext context_provider
layout_builder_test.i_have_runtime_contexts core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.services.yml Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts context_provider
library.dependency_resolver core/core.services.yml Drupal\Core\Asset\LibraryDependencyResolver
library.discovery core/core.services.yml Drupal\Core\Asset\LibraryDiscovery
library.discovery.collector core/core.services.yml Drupal\Core\Asset\LibraryDiscoveryCollector needs_destruction
library.discovery.parser core/core.services.yml Drupal\Core\Asset\LibraryDiscoveryParser
library.libraries_directory_file_finder core/core.services.yml Drupal\Core\Asset\LibrariesDirectoryFileFinder
link_generator core/core.services.yml Drupal\Core\Utility\LinkGenerator
locale.config_manager core/modules/locale/locale.services.yml Drupal\locale\LocaleConfigManager
locale.config_subscriber core/modules/locale/locale.services.yml Drupal\locale\LocaleConfigSubscriber
locale.default.config.storage core/modules/locale/locale.services.yml Drupal\locale\LocaleDefaultConfigStorage
locale.locale_translation_cache_tag core/modules/locale/locale.services.yml Drupal\locale\EventSubscriber\LocaleTranslationCacheTag
locale.plural.formula core/modules/locale/locale.services.yml Drupal\locale\PluralFormula
locale.project core/modules/locale/locale.services.yml Drupal\locale\LocaleProjectStorage
locale.storage core/modules/locale/locale.services.yml Drupal\locale\StringDatabaseStorage backend_overridable
lock core/core.services.yml Drupal\Core\Lock\DatabaseLockBackend backend_overridable
lock.persistent core/core.services.yml Drupal\Core\Lock\PersistentDatabaseLockBackend backend_overridable
logger.advisory_feed_test core/modules/system/tests/modules/advisory_feed_test/advisory_feed_test.services.yml Drupal\advisory_feed_test\TestSystemLoggerChannel
logger.broken core/modules/system/tests/modules/error_service_test/error_service_test.services.yml Drupal\error_service_test\Logger\TestLog logger, backend_overridable
logger.channel.announcements_feed core/modules/announcements_feed/announcements_feed.services.yml
logger.channel.ckeditor5 core/modules/ckeditor5/ckeditor5.services.yml
logger.channel.contact core/modules/contact/contact.services.yml Drupal\Core\Logger\LoggerChannel
logger.channel.cron core/core.services.yml

Other projects


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