Services - main - 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 912

Title File name Summary All service tags
jsonapi.entity_resource core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Controller\EntityResource
jsonapi.exception_subscriber core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber
jsonapi.field_resolver core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Context\FieldResolver
jsonapi.file_upload core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Controller\FileUpload
jsonapi.include_resolver core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\IncludeResolver
jsonapi.maintenance_mode_subscriber core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\EventSubscriber\JsonapiMaintenanceModeSubscriber
jsonapi.normalization_cacher core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\EventSubscriber\ResourceObjectNormalizationCacher
jsonapi.resource_response.subscriber core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber
jsonapi.resource_type.repository core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\ResourceType\ResourceTypeRepository
jsonapi.resource_type.repository.jsonapi_test_field_aliasing core/modules/jsonapi/tests/modules/jsonapi_test_field_aliasing/jsonapi_test_field_aliasing.services.yml Drupal\jsonapi_test_field_aliasing\ResourceType\AliasingResourceTypeRepository
jsonapi.resource_version.route_enhancer core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Revisions\ResourceVersionRouteEnhancer route_enhancer
jsonapi.route_enhancer core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Routing\RouteEnhancer route_enhancer
jsonapi.route_filter.format_setter core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Routing\EarlyFormatSetter route_filter
jsonapi.serializer core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Serializer\Serializer
jsonapi.version_negotiator core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Revisions\VersionNegotiator service_collector
jsonapi.version_negotiator.default core/modules/jsonapi/jsonapi.services.yml Abstract
jsonapi.version_negotiator.id core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Revisions\VersionById jsonapi_version_negotiator
jsonapi.version_negotiator.rel core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Revisions\VersionByRel jsonapi_version_negotiator
jsonapi_test_meta_events.meta_subscriber core/modules/jsonapi/tests/modules/jsonapi_test_meta_events/jsonapi_test_meta_events.services.yml Drupal\jsonapi_test_meta_events\EventSubscriber\MetaEventSubscriber event_subscriber
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 event_subscriber
jsonapi_test_resource_type_building.late_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\LateResourceTypeBuildEventSubscriber event_subscriber
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.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_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_field_block_test.fake_view_mode_context core/modules/layout_builder/tests/modules/layout_builder_field_block_test/layout_builder_field_block_test.services.yml Drupal\layout_builder_field_block_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\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

Other projects


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