Services - 9.5.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 905

Title File name Summary All service tags
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 event_subscriber
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
theme.negotiator.system.batch core/modules/system/system.services.yml Drupal\system\Theme\BatchNegotiator theme_negotiator
theme.negotiator.system.db_update core/modules/system/system.services.yml Drupal\system\Theme\DbUpdateNegotiator theme_negotiator
theme.negotiator.test_custom_theme core/modules/system/tests/modules/theme_test/theme_test.services.yml Drupal\theme_test\Theme\CustomThemeNegotiator theme_negotiator
theme.negotiator.test_theme core/modules/system/tests/modules/menu_test/menu_test.services.yml Drupal\menu_test\Theme\TestThemeNegotiator theme_negotiator
theme.registry core/core.services.yml Drupal\Core\Theme\Registry needs_destruction
theme_handler core/core.services.yml Drupal\Core\Extension\ThemeHandler
theme_installer core/core.services.yml Drupal\Core\Extension\ThemeInstaller
theme_test.subscriber core/modules/system/tests/modules/theme_test/theme_test.services.yml Drupal\theme_test\EventSubscriber\ThemeTestSubscriber event_subscriber
title_resolver core/core.services.yml Drupal\Core\Controller\TitleResolver
token core/core.services.yml Drupal\Core\Utility\Token
toolbar.menu_tree core/modules/toolbar/toolbar.services.yml Drupal\toolbar\Menu\ToolbarMenuLinkTree
toolbar.page_cache_request_policy.allow_toolbar_path core/modules/toolbar/toolbar.services.yml Drupal\toolbar\PageCache\AllowToolbarPath page_cache_request_policy
transliteration core/core.services.yml Drupal\Core\Transliteration\PhpTransliteration
twig core/core.services.yml Drupal\Core\Template\TwigEnvironment service_collector
twig.extension core/core.services.yml Drupal\Core\Template\TwigExtension twig.extension
twig.extension.debug core/core.services.yml Twig\Extension\DebugExtension twig.extension
twig.extension.varDumper core/core.services.yml Drupal\Core\Template\DebugExtension twig.extension
twig.loader core/core.services.yml Twig\Loader\ChainLoader service_collector
twig.loader.filesystem core/core.services.yml Drupal\Core\Template\Loader\FilesystemLoader twig.loader
twig.loader.string core/core.services.yml Drupal\Core\Template\Loader\StringLoader twig.loader
twig.loader.theme_registry core/core.services.yml Drupal\Core\Template\Loader\ThemeRegistryLoader twig.loader
twig_extension_test.twig.test_extension core/modules/system/tests/modules/twig_extension_test/twig_extension_test.services.yml Drupal\twig_extension_test\TwigExtension\TestExtension twig.extension
twig_loader_test.twig.test_loader core/modules/system/tests/modules/twig_loader_test/twig_loader_test.services.yml Drupal\twig_loader_test\Loader\TestLoader twig.loader
typed_data_manager core/core.services.yml Drupal\Core\TypedData\TypedDataManager plugin_manager_cache_clear
unrouted_url_assembler core/core.services.yml Drupal\Core\Utility\UnroutedUrlAssembler
update.fetcher core/modules/update/update.services.yml Drupal\update\UpdateFetcher
update.manager core/modules/update/update.services.yml Drupal\update\UpdateManager
update.post_update_registry core/core.services.yml Drupal\Core\Update\UpdateRegistry event_subscriber
update.post_update_registry_factory core/core.services.yml Drupal\Core\Update\UpdateRegistryFactory
update.processor core/modules/update/update.services.yml Drupal\update\UpdateProcessor
update.root core/modules/update/update.services.yml Drupal\update\UpdateRoot
update.update_hook_registry core/core.services.yml Drupal\Core\Update\UpdateHookRegistry

Other projects


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