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
stream_wrapper.public core/core.services.yml Drupal\Core\StreamWrapper\PublicStream stream_wrapper
stream_wrapper.temporary core/core.services.yml Drupal\Core\StreamWrapper\TemporaryStream stream_wrapper
stream_wrapper.translations core/modules/locale/locale.services.yml Drupal\locale\StreamWrapper\TranslationsStream stream_wrapper
stream_wrapper_manager core/core.services.yml Drupal\Core\StreamWrapper\StreamWrapperManager
string_translation core/core.services.yml Drupal\Core\StringTranslation\TranslationManager service_collector
string_translator.custom_strings core/core.services.yml Drupal\Core\StringTranslation\Translator\CustomStrings string_translator
string_translator.locale.lookup core/modules/locale/locale.services.yml Drupal\locale\LocaleTranslation string_translator, needs_destruction
Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface core/core.services.yml
Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface core/core.services.yml
Symfony\Component\HttpFoundation\RequestStack core/core.services.yml
Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface core/core.services.yml
Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface core/core.services.yml
Symfony\Component\HttpFoundation\Session\SessionInterface core/core.services.yml
Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactoryInterface core/core.services.yml
Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface core/core.services.yml
Symfony\Component\HttpKernel\Controller\ControllerResolverInterface core/core.services.yml
Symfony\Component\HttpKernel\HttpKernelInterface core/core.services.yml
Symfony\Component\Routing\Generator\UrlGeneratorInterface core/core.services.yml
Symfony\Contracts\EventDispatcher\EventDispatcherInterface core/core.services.yml
system.access_route_alter_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AccessRouteAlterSubscriber
system.admin_path.route_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdminRouteSubscriber
system.advisories_config_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdvisoriesConfigSubscriber
system.breadcrumb.default core/modules/system/system.services.yml Drupal\system\PathBasedBreadcrumbBuilder breadcrumb_builder
system.config_cache_tag core/modules/system/system.services.yml Drupal\system\EventSubscriber\ConfigCacheTag
system.config_subscriber core/modules/system/system.services.yml Drupal\system\SystemConfigSubscriber
system.file_event.subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\SecurityFileUploadEventSubscriber
system.manager core/modules/system/system.services.yml Drupal\system\SystemManager
system.menus.route_subscriber core/modules/system/system.services.yml Drupal\system\Routing\MenuLinksetRoutes
system.module_admin_links_helper core/modules/system/system.services.yml Drupal\system\ModuleAdminLinksHelper
system.module_admin_links_memory_cache core/modules/system/system.services.yml Drupal\Core\Cache\MemoryCache\MemoryCache
system.sa_fetcher core/modules/system/system.services.yml Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher
system.timezone_resolver core/modules/system/system.services.yml Drupal\system\TimeZoneResolver
taxonomy_term.breadcrumb core/modules/taxonomy/taxonomy.services.yml Drupal\taxonomy\TermBreadcrumbBuilder breadcrumb_builder
taxonomy_term.taxonomy_term_route_context core/modules/taxonomy/taxonomy.services.yml Drupal\taxonomy\ContextProvider\TermRouteContext context_provider
tempstore.private core/core.services.yml Drupal\Core\TempStore\PrivateTempStoreFactory backend_overridable
tempstore.shared core/core.services.yml Drupal\Core\TempStore\SharedTempStoreFactory backend_overridable
test_domain_object.view_subscriber core/modules/system/tests/modules/early_rendering_controller_test/early_rendering_controller_test.services.yml Drupal\early_rendering_controller_test\TestDomainObjectViewSubscriber
test_service core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestService
test_service2 core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestService
test_service2_decorator core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestServiceDecorator
test_service2_decorator2 core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestServiceDecorator
test_service_decorator core/modules/system/tests/modules/decorated_service_test/decorated_service_test.services.yml Drupal\decorated_service_test\TestServiceDecorator
theme.initialization core/core.services.yml Drupal\Core\Theme\ThemeInitialization
theme.manager core/core.services.yml Drupal\Core\Theme\ThemeManager
theme.negotiator core/core.services.yml Drupal\Core\Theme\ThemeNegotiator service_id_collector
theme.negotiator.admin_theme core/modules/user/user.services.yml Drupal\user\Theme\AdminNegotiator theme_negotiator
theme.negotiator.ajax_base_page core/core.services.yml Drupal\Core\Theme\AjaxBasePageNegotiator theme_negotiator
theme.negotiator.block.admin_demo core/modules/block/block.services.yml Drupal\block\Theme\AdminDemoNegotiator theme_negotiator
theme.negotiator.default core/core.services.yml Drupal\Core\Theme\DefaultNegotiator theme_negotiator
theme.negotiator.high_priority core/modules/system/tests/modules/theme_test/theme_test.services.yml Drupal\theme_test\Theme\HighPriorityThemeNegotiator theme_negotiator

Other projects


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