Services - 11.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
views.executable core/modules/views/views.services.yml Drupal\views\ViewExecutableFactory
views.exposed_form_cache core/modules/views/views.services.yml Drupal\views\ExposedFormCache
views.route_subscriber core/modules/views/views.services.yml Drupal\views\EventSubscriber\RouteSubscriber
views.views_data core/modules/views/views.services.yml Drupal\views\ViewsData backend_overridable
views.views_data_helper core/modules/views/views.services.yml Drupal\views\ViewsDataHelper
workflows.access_check.extended_permissions core/modules/workflows/workflows.services.yml Drupal\workflows\WorkflowStateTransitionOperationsAccessCheck access_check
workspaces.association core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspaceAssociation backend_overridable
workspaces.controller.entity_form core/modules/workspaces/workspaces.services.yml Drupal\workspaces\Controller\WorkspacesHtmlEntityFormController
workspaces.entity.query.sql core/modules/workspaces/workspaces.services.yml Drupal\workspaces\EntityQuery\QueryFactory backend_overridable
workspaces.entity_schema_listener core/modules/workspaces/workspaces.services.yml Drupal\workspaces\EventSubscriber\EntitySchemaSubscriber
workspaces.information core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspaceInformation
workspaces.lazy_builders core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspacesLazyBuilders
workspaces.manager core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspaceManager service_id_collector
workspaces.menu.tree_storage core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspacesMenuTreeStorage backend_overridable
workspaces.negotiator.query_parameter core/modules/workspaces/workspaces.services.yml Drupal\workspaces\Negotiator\QueryParameterWorkspaceNegotiator workspace_negotiator
workspaces.negotiator.session core/modules/workspaces/workspaces.services.yml Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator workspace_negotiator
workspaces.operation_factory core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspaceOperationFactory
workspaces.repository core/modules/workspaces/workspaces.services.yml Drupal\workspaces\WorkspaceRepository
workspaces.workspace_subscriber core/modules/workspaces/workspaces.services.yml Drupal\workspaces\EventSubscriber\WorkspaceRequestSubscriber
workspace_update_test.negotiator.test core/modules/workspaces/tests/modules/workspace_update_test/workspace_update_test.services.yml Drupal\workspace_update_test\Negotiator\TestWorkspaceNegotiator workspace_negotiator
_defaults core/modules/media/media.services.yml
_defaults core/modules/media/tests/modules/media_test_embed/media_test_embed.services.yml
_defaults core/modules/file/file.services.yml
_defaults core/modules/file/tests/modules/file_validator_test/file_validator_test.services.yml
_defaults core/modules/locale/locale.services.yml
_defaults core/modules/language/language.services.yml
_defaults core/modules/dynamic_page_cache/dynamic_page_cache.services.yml
_defaults core/modules/jsonapi/jsonapi.services.yml
_defaults core/modules/jsonapi/tests/modules/jsonapi_test_resource_type_building/jsonapi_test_resource_type_building.services.yml
_defaults core/modules/config_translation/config_translation.services.yml
_defaults core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.services.yml
_defaults core/modules/media_library/media_library.services.yml
_defaults core/modules/layout_builder/layout_builder.services.yml
_defaults core/modules/layout_builder/tests/modules/layout_builder_element_test/layout_builder_element_test.services.yml
_defaults core/modules/content_moderation/content_moderation.services.yml
_defaults core/modules/workspaces/workspaces.services.yml
_defaults core/modules/sdc/sdc.services.yml
_defaults core/modules/ckeditor5/ckeditor5.services.yml
_defaults core/modules/node/node.services.yml
_defaults core/modules/config/config.services.yml
_defaults core/modules/config/tests/config_collection_install_test/config_collection_install_test.services.yml
_defaults core/modules/config/tests/config_events_test/config_events_test.services.yml
_defaults core/modules/config/tests/config_transformer_test/config_transformer_test.services.yml
_defaults core/modules/config/tests/config_import_test/config_import_test.services.yml
_defaults core/modules/path_alias/path_alias.services.yml
_defaults core/modules/serialization/serialization.services.yml
_defaults core/modules/views/views.services.yml
_defaults core/modules/rest/rest.services.yml
_defaults core/modules/field_ui/field_ui.services.yml
_defaults core/modules/migrate/migrate.services.yml

Other projects


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