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
accept_header_matcher core/modules/system/tests/modules/accept_header_routing_test/accept_header_routing_test.services.yml Drupal\accept_header_routing_test\Routing\AcceptHeaderMatcher route_filter
access_check.admin_menu_block_page core/modules/system/system.services.yml Drupal\system\Access\SystemAdminMenuBlockAccessCheck access_check
access_check.admin_overview_page core/modules/system/system.services.yml Drupal\system\Access\SystemAdminMenuBlockAccessCheck access_check
access_check.book.removable core/modules/book/book.services.yml Drupal\book\Access\BookNodeIsRemovableAccessCheck access_check
access_check.contact_personal core/modules/contact/contact.services.yml Drupal\contact\Access\ContactPageAccess access_check
access_check.cron core/modules/system/system.services.yml Drupal\system\Access\CronAccessCheck access_check
access_check.db_update core/modules/system/system.services.yml Drupal\system\Access\DbUpdateAccessCheck access_check
access_check.entity.layout_builder_access core/modules/layout_builder/layout_builder.services.yml Drupal\layout_builder\Access\LayoutBuilderAccessCheck access_check
access_check.field_ui.field_reuse core/modules/field_ui/field_ui.services.yml Drupal\field_ui\Access\FieldReuseAccessCheck access_check
access_check.field_ui.form_mode core/modules/field_ui/field_ui.services.yml Drupal\field_ui\Access\FormModeAccessCheck access_check
access_check.field_ui.view_mode core/modules/field_ui/field_ui.services.yml Drupal\field_ui\Access\ViewModeAccessCheck access_check
access_check.jsonapi.relationship_route_access core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Access\RelationshipRouteAccessCheck access_check
access_check.latest_revision core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\Access\LatestRevisionCheck access_check
access_check.menu_test_session core/modules/system/tests/modules/menu_test/menu_test.services.yml Drupal\menu_test\Access\AccessCheck access_check
access_check.node.preview core/modules/node/node.services.yml Drupal\node\Access\NodePreviewAccessCheck access_check
access_check.permission core/modules/user/user.services.yml Drupal\user\Access\PermissionAccessCheck access_check
access_check.settings_tray.block.has_overrides core/modules/settings_tray/settings_tray.services.yml Drupal\settings_tray\Access\BlockHasOverridesAccessCheck access_check
access_check.settings_tray.block.settings_tray_form core/modules/settings_tray/settings_tray.services.yml Drupal\settings_tray\Access\BlockPluginHasSettingsTrayFormAccessCheck access_check
access_check.update.manager_access core/modules/update/update.services.yml Drupal\update\Access\UpdateManagerAccessCheck access_check
access_check.user.login_status core/modules/user/user.services.yml Drupal\user\Access\LoginStatusCheck access_check
access_check.user.register core/modules/user/user.services.yml Drupal\user\Access\RegisterAccessCheck access_check
access_check.user.role core/modules/user/user.services.yml Drupal\user\Access\RoleAccessCheck access_check
access_check.workspaces.active_workspace core/modules/workspaces/workspaces.services.yml Drupal\workspaces\Access\ActiveWorkspaceCheck access_check
announcements_feed.fetcher core/modules/announcements_feed/announcements_feed.services.yml Drupal\announcements_feed\AnnounceFetcher
announcements_feed.lazy_builders core/modules/announcements_feed/announcements_feed.services.yml Drupal\announcements_feed\LazyBuilders
announcements_feed.renderer core/modules/announcements_feed/announcements_feed.services.yml Drupal\announcements_feed\AnnounceRenderer
announce_feed_test.announce_client_middleware core/modules/announcements_feed/tests/modules/announce_feed_test/announce_feed_test.services.yml Drupal\announce_feed_test\AnnounceTestHttpClientMiddleware http_client_middleware
automated_cron.subscriber core/modules/automated_cron/automated_cron.services.yml Drupal\automated_cron\EventSubscriber\AutomatedCron
ban.ip_manager core/modules/ban/ban.services.yml Drupal\ban\BanIpManager backend_overridable
ban.middleware core/modules/ban/ban.services.yml Drupal\ban\BanMiddleware http_middleware
basic_auth.authentication.basic_auth core/modules/basic_auth/basic_auth.services.yml Drupal\basic_auth\Authentication\Provider\BasicAuth authentication_provider
basic_auth.page_cache_request_policy.disallow_basic_auth_requests core/modules/basic_auth/basic_auth.services.yml Drupal\basic_auth\PageCache\DisallowBasicAuthRequests page_cache_request_policy
big_pipe core/modules/big_pipe/big_pipe.services.yml Drupal\big_pipe\Render\BigPipe
big_pipe_test_subscriber core/modules/big_pipe/tests/modules/big_pipe_test/big_pipe_test.services.yml Drupal\big_pipe_test\EventSubscriber\BigPipeTestSubscriber
block.page_display_variant_subscriber core/modules/block/block.services.yml Drupal\block\EventSubscriber\BlockPageDisplayVariantSubscriber
block.repository core/modules/block/block.services.yml Drupal\block\BlockRepository
block_content.bc_subscriber core/modules/block_content/block_content.services.yml Drupal\block_content\Routing\RouteSubscriber
block_content.uuid_lookup core/modules/block_content/block_content.services.yml \Drupal\block_content\BlockContentUuidLookup needs_destruction
block_test.multiple_static_context core/modules/block/tests/modules/block_test/block_test.services.yml Drupal\block_test\ContextProvider\MultipleStaticContext context_provider
book.backend_chained_cache core/modules/book/book.services.yml Drupal\Core\Cache\BackendChain cache.bin.memory
book.breadcrumb core/modules/book/book.services.yml Drupal\book\BookBreadcrumbBuilder breadcrumb_builder
book.export core/modules/book/book.services.yml Drupal\book\BookExport
book.manager core/modules/book/book.services.yml Drupal\book\BookManager
book.memory_cache core/modules/book/book.services.yml Drupal\Core\Cache\MemoryCache\MemoryCacheInterface cache.bin.memory
book.outline core/modules/book/book.services.yml Drupal\book\BookOutline
book.outline_storage core/modules/book/book.services.yml Drupal\book\BookOutlineStorage backend_overridable
book.uninstall_validator core/modules/book/book.services.yml Drupal\book\BookUninstallValidator module_install.uninstall_validator
breakpoint.manager core/modules/breakpoint/breakpoint.services.yml Drupal\breakpoint\BreakpointManager plugin_manager_cache_clear
broken_class_with_missing_dependency core/modules/system/tests/modules/error_service_test/error_service_test.services.yml Drupal\error_service_test\LonelyMonkeyClass
cache.backend.null core/assets/scaffold/files/development.services.yml Drupal\Core\Cache\NullBackendFactory

Other projects


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