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
file.repository core/modules/file/file.services.yml Drupal\file\FileRepository
file.upload_handler core/modules/file/file.services.yml Drupal\file\Upload\FileUploadHandler
file.usage core/modules/file/file.services.yml Drupal\file\FileUsage\DatabaseFileUsageBackend backend_overridable
file.validator core/modules/file/file.services.yml Drupal\file\Validation\FileValidator
file_validation_sanitization_subscriber core/modules/file/tests/modules/file_validator_test/file_validator_test.services.yml Drupal\file_validator_test\EventSubscriber\FileSanitizationEventSubscriber
file_validation_test_subscriber core/modules/file/tests/modules/file_validator_test/file_validator_test.services.yml Drupal\file_validator_test\EventSubscriber\FileValidationTestSubscriber
filter.uninstall_validator core/modules/filter/filter.services.yml Drupal\filter\FilterUninstallValidator
form_test.event_subscriber core/modules/system/tests/modules/form_test/form_test.services.yml Drupal\form_test\EventSubscriber\FormTestEventSubscriber
form_test.form.service_form core/modules/system/tests/modules/form_test/form_test.services.yml Drupal\form_test\FormTestServiceObject
form_test.http_middleware core/modules/system/tests/modules/form_test/form_test.services.yml Drupal\form_test\StackMiddleware\FormTestMiddleware http_middleware
forum.breadcrumb.listing core/modules/forum/forum.services.yml Drupal\forum\Breadcrumb\ForumListingBreadcrumbBuilder breadcrumb_builder
forum.breadcrumb.node core/modules/forum/forum.services.yml Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder breadcrumb_builder
forum.index_storage core/modules/forum/forum.services.yml Drupal\forum\ForumIndexStorage backend_overridable
forum.uninstall_validator core/modules/forum/forum.services.yml Drupal\forum\ForumUninstallValidator module_install.uninstall_validator
forum_manager core/modules/forum/forum.services.yml Drupal\forum\ForumManager backend_overridable
forum_url_alter_test.path_processor core/modules/forum/tests/modules/forum_url_alter_test/forum_url_alter_test.services.yml Drupal\forum_url_alter_test\PathProcessorTest path_processor_inbound, path_processor_outbound
help.breadcrumb core/modules/help/help.services.yml Drupal\help\HelpBreadcrumbBuilder breadcrumb_builder
help.twig.loader core/modules/help/help.services.yml Drupal\help\HelpTopicTwigLoader twig.loader
help_test_twig.extension core/modules/help/tests/modules/help_topics_twig_tester/help_topics_twig_tester.services.yml Drupal\help_topics_twig_tester\HelpTestTwigExtension twig.extension
help_twig.extension core/modules/help/help.services.yml Drupal\help\HelpTwigExtension twig.extension
hold_test.response core/modules/system/tests/modules/hold_test/hold_test.services.yml Drupal\hold_test\EventSubscriber\HoldTestSubscriber
html_response.attachments_processor.big_pipe core/modules/big_pipe/big_pipe.services.yml \Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor
html_response.big_pipe_subscriber core/modules/big_pipe/big_pipe.services.yml Drupal\big_pipe\EventSubscriber\HtmlResponseBigPipeSubscriber
http_client.advisory_feed_test core/modules/system/tests/modules/advisory_feed_test/advisory_feed_test.services.yml Drupal\advisory_feed_test\AdvisoryTestClientMiddleware http_client_middleware
http_kernel_test.test_middleware core/modules/system/tests/modules/http_kernel_test/http_kernel_test.services.yml Drupal\http_kernel_test\HttpKernel\TestMiddleware http_middleware
http_kernel_test.test_middleware2 core/modules/system/tests/modules/http_kernel_test/http_kernel_test.services.yml Drupal\http_kernel_test\HttpKernel\TestMiddleware http_middleware
http_middleware.alter_content_middleware core/modules/system/tests/modules/http_middleware_test/http_middleware_test.services.yml Drupal\http_middleware_test\StackMiddleware\AlterContentMiddleware http_middleware
http_middleware.big_pipe core/modules/big_pipe/big_pipe.services.yml \Drupal\big_pipe\StackMiddleware\ContentLength http_middleware
http_middleware.monkeys core/modules/system/tests/modules/error_service_test/error_service_test.services.yml Drupal\error_service_test\MonkeysInTheControlRoom http_middleware
http_middleware.page_cache core/modules/page_cache/page_cache.services.yml Drupal\page_cache\StackMiddleware\PageCache http_middleware
image.page_cache_response_policy.deny_private_image_style_download core/modules/image/image.services.yml Drupal\image\PageCache\DenyPrivateImageStyleDownload page_cache_response_policy
inline_block.usage core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\InlineBlockUsage
jsonapi.custom_query_parameter_names_validator.subscriber core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\EventSubscriber\JsonApiRequestValidator
jsonapi.entity_access_checker core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Access\EntityAccessChecker
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_response_validator.subscriber core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\EventSubscriber\ResourceResponseValidator
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

Other projects


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