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
layout_builder.routes core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Routing\LayoutBuilderRoutes event_subscriber
layout_builder.sample_entity_generator core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Entity\LayoutBuilderSampleEntityGenerator
layout_builder.tempstore_repository core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\LayoutTempstoreRepository
layout_builder_fieldblock_test.fake_view_mode_context core/modules/layout_builder/tests/modules/layout_builder_fieldblock_test/layout_builder_fieldblock_test.services.yml Drupal\layout_builder_fieldblock_test\ContextProvider\FakeViewModeContext context_provider
library.dependency_resolver core/core.services.yml Drupal\Core\Asset\LibraryDependencyResolver
library.discovery core/core.services.yml Drupal\Core\Asset\LibraryDiscovery
library.discovery.collector 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
link_generator core/core.services.yml Drupal\Core\Utility\LinkGenerator
locale.config_manager core/modules/locale/locale.services.yml Drupal\locale\LocaleConfigManager
locale.config_subscriber core/modules/locale/locale.services.yml Drupal\locale\LocaleConfigSubscriber event_subscriber
locale.default.config.storage core/modules/locale/locale.services.yml Drupal\locale\LocaleDefaultConfigStorage
locale.locale_translation_cache_tag core/modules/locale/locale.services.yml Drupal\locale\EventSubscriber\LocaleTranslationCacheTag event_subscriber
locale.plural.formula core/modules/locale/locale.services.yml Drupal\locale\PluralFormula
locale.project core/modules/locale/locale.services.yml Drupal\locale\LocaleProjectStorage
locale.storage core/modules/locale/locale.services.yml Drupal\locale\StringDatabaseStorage backend_overridable
lock core/core.services.yml Drupal\Core\Lock\DatabaseLockBackend backend_overridable
lock.persistent core/core.services.yml Drupal\Core\Lock\PersistentDatabaseLockBackend backend_overridable
logger.broken core/modules/system/tests/modules/error_service_test/error_service_test.services.yml Drupal\error_service_test\Logger\TestLog logger, backend_overridable
logger.channel.aggregator core/modules/aggregator/aggregator.services.yml
logger.channel.contact core/modules/contact/contact.services.yml Drupal\Core\Logger\LoggerChannel
logger.channel.cron core/core.services.yml
logger.channel.default core/core.services.yml
logger.channel.file core/core.services.yml Drupal\Core\Logger\LoggerChannel
logger.channel.form core/core.services.yml
logger.channel.image core/core.services.yml
logger.channel.jsonapi core/modules/jsonapi/jsonapi.services.yml
logger.channel.layout_builder core/modules/layout_builder/layout_builder.services.yml
logger.channel.migrate_drupal core/modules/migrate_drupal/migrate_drupal.services.yml
logger.channel.php core/core.services.yml
logger.channel.rest core/modules/rest/rest.services.yml
logger.channel.security core/core.services.yml
logger.channel.workspaces core/modules/workspaces/workspaces.services.yml
logger.channel_base core/core.services.yml Drupal\Core\Logger\LoggerChannel
logger.dblog core/modules/dblog/dblog.services.yml Drupal\dblog\Logger\DbLog logger, backend_overridable
logger.factory core/core.services.yml Drupal\Core\Logger\LoggerChannelFactory service_collector
logger.log_message_parser core/core.services.yml Drupal\Core\Logger\LogMessageParser
logger.syslog core/modules/syslog/syslog.services.yml Drupal\syslog\Logger\SysLog logger
logger.syslog_test core/modules/syslog/tests/modules/syslog_test/syslog_test.services.yml Drupal\syslog_test\Logger\SysLogTest logger
maintenance_mode core/core.services.yml Drupal\Core\Site\MaintenanceMode
maintenance_mode_subscriber core/core.services.yml Drupal\Core\EventSubscriber\MaintenanceModeSubscriber event_subscriber
main_content_renderer.ajax core/core.services.yml Drupal\Core\Render\MainContent\AjaxRenderer render.main_content_renderer
main_content_renderer.dialog core/core.services.yml Drupal\Core\Render\MainContent\DialogRenderer render.main_content_renderer
main_content_renderer.extra_wide_modal core/modules/system/tests/modules/dialog_renderer_test/dialog_renderer_test.services.yml Drupal\dialog_renderer_test\Render\MainContent\WideModalRenderer render.main_content_renderer
main_content_renderer.html core/core.services.yml Drupal\Core\Render\MainContent\HtmlRenderer render.main_content_renderer
main_content_renderer.json core/modules/system/tests/modules/common_test/common_test.services.yml Drupal\common_test\Render\MainContent\JsonRenderer render.main_content_renderer
main_content_renderer.modal core/core.services.yml Drupal\Core\Render\MainContent\ModalRenderer render.main_content_renderer
main_content_renderer.off_canvas core/core.services.yml Drupal\Core\Render\MainContent\OffCanvasRenderer render.main_content_renderer
main_content_renderer.off_canvas_top core/core.services.yml Drupal\Core\Render\MainContent\OffCanvasRenderer render.main_content_renderer

Other projects


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