Services - 8.9.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 893

Title File name Summary All service tags
session_test.subscriber core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\EventSubscriber\SessionTestSubscriber event_subscriber
settings core/core.services.yml Drupal\Core\Site\Settings
settings_tray.route_processor_off_canvas_form_bc core/modules/settings_tray/settings_tray.services.yml \Drupal\settings_tray\RouteProcessor\BlockEntityOffCanvasFormRouteProcessorBC route_processor_outbound
settings_tray_override_test.overrider core/modules/settings_tray/tests/modules/settings_tray_override_test/settings_tray_override_test.services.yml Drupal\settings_tray_override_test\ConfigOverrider config.factory.override
shortcut.lazy_builders core/modules/shortcut/shortcut.services.yml Drupal\shortcut\ShortcutLazyBuilders
site.path core/core.services.yml SplString parameter_service
site.path.factory core/core.services.yml Drupal\Core\SitePathFactory
sqlite.views.date_sql core/modules/views/views.services.yml Drupal\views\Plugin\views\query\SqliteDateSql
state core/core.services.yml Drupal\Core\State\State
statistics.storage.node core/modules/statistics/statistics.services.yml Drupal\statistics\NodeStatisticsDatabaseStorage backend_overridable
stream_wrapper.dummy core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyStreamWrapper stream_wrapper
stream_wrapper.dummy_readonly core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyReadOnlyStreamWrapper stream_wrapper
stream_wrapper.dummy_remote core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyRemoteStreamWrapper stream_wrapper
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
system.admin_path.route_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdminRouteSubscriber event_subscriber
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 event_subscriber
system.config_subscriber core/modules/system/system.services.yml Drupal\system\SystemConfigSubscriber event_subscriber
system.manager core/modules/system/system.services.yml Drupal\system\SystemManager
system.timezone_resolver core/modules/system/system.services.yml Drupal\system\TimeZoneResolver event_subscriber
taxonomy_term.breadcrumb core/modules/taxonomy/taxonomy.services.yml Drupal\taxonomy\TermBreadcrumbBuilder breadcrumb_builder
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_discovery core/modules/simpletest/simpletest.services.yml Drupal\simpletest\TestDiscovery
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
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

Other projects


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