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
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.logger_aware_test core/modules/system/tests/modules/logger_aware_test/logger_aware_test.services.yml
logger.channel.logger_stub core/modules/system/tests/modules/logger_aware_test/logger_aware_test.services.yml Drupal\logger_aware_test\LoggerStub
logger.channel.mail core/core.services.yml
logger.channel.menu core/core.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.router core/core.services.yml
logger.channel.security core/core.services.yml
logger.channel.system core/modules/system/system.services.yml
logger.channel.update core/modules/update/update.services.yml
logger.channel.user core/modules/user/user.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
logger_aware_test.logger_aware_existing core/modules/system/tests/modules/logger_aware_test/logger_aware_test.services.yml Drupal\logger_aware_test\LoggerAwareStub
logger_aware_test.logger_aware_stub core/modules/system/tests/modules/logger_aware_test/logger_aware_test.services.yml Drupal\logger_aware_test\LoggerAwareStub
maintenance_mode core/core.services.yml Drupal\Core\Site\MaintenanceMode
maintenance_mode_subscriber core/core.services.yml Drupal\Core\EventSubscriber\MaintenanceModeSubscriber
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
main_content_renderer.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_view_subscriber core/core.services.yml Drupal\Core\EventSubscriber\MainContentViewSubscriber
media.config_subscriber core/modules/media/media.services.yml Drupal\media\EventSubscriber\MediaConfigSubscriber
media.oembed.iframe_url_helper core/modules/media/media.services.yml Drupal\media\IFrameUrlHelper
media.oembed.provider_repository core/modules/media/media.services.yml Drupal\media\OEmbed\ProviderRepository
media.oembed.resource_fetcher core/modules/media/media.services.yml Drupal\media\OEmbed\ResourceFetcher
media.oembed.url_resolver core/modules/media/media.services.yml Drupal\media\OEmbed\UrlResolver
media_library.opener.editor core/modules/media_library/media_library.services.yml Drupal\media_library\MediaLibraryEditorOpener
media_library.opener.field_widget core/modules/media_library/media_library.services.yml Drupal\media_library\MediaLibraryFieldWidgetOpener
media_library.opener_resolver core/modules/media_library/media_library.services.yml Drupal\media_library\OpenerResolver service_collector
media_library.route_subscriber core/modules/media_library/media_library.services.yml Drupal\media_library\Routing\RouteSubscriber
media_library.ui_builder core/modules/media_library/media_library.services.yml Drupal\media_library\MediaLibraryUiBuilder
media_test_embed.route_subscriber core/modules/media/tests/modules/media_test_embed/media_test_embed.services.yml Drupal\media_test_embed\Routing\RouteSubscriber

Other projects


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