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
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.system core/modules/system/system.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
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
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 event_subscriber
media.config_subscriber core/modules/media/media.services.yml Drupal\media\EventSubscriber\MediaConfigSubscriber event_subscriber
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
media_library.route_subscriber core/modules/media_library/media_library.services.yml Drupal\media_library\Routing\RouteSubscriber event_subscriber
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 event_subscriber
menu.active_trail core/core.services.yml Drupal\Core\Menu\MenuActiveTrail needs_destruction
menu.default_tree_manipulators core/core.services.yml Drupal\Core\Menu\DefaultMenuLinkTreeManipulators
menu.link_tree core/core.services.yml Drupal\Core\Menu\MenuLinkTree
menu.parent_form_selector core/core.services.yml Drupal\Core\Menu\MenuParentFormSelector
menu.rebuild_subscriber core/core.services.yml Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber event_subscriber
menu.tree_storage core/core.services.yml Drupal\Core\Menu\MenuTreeStorage backend_overridable
menu_link.static.overrides core/core.services.yml Drupal\Core\Menu\StaticMenuLinkOverrides
messenger core/core.services.yml Drupal\Core\Messenger\Messenger
method_filter core/core.services.yml Drupal\Core\Routing\MethodFilter route_filter
method_filter.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Routing\ReadOnlyModeMethodFilter

Other projects


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