Services - main - 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 912

Title File name Summary All service tags
Drupal\Core\Database\EventSubscriber\StatementExecutionSubscriber core/core.services.yml
Drupal\Core\Datetime\DatePreprocess core/core.services.yml Drupal\Core\Datetime\DatePreprocess
Drupal\Core\DefaultContent\AdminAccountSwitcher core/core.services.yml
Drupal\Core\DefaultContent\Exporter core/core.services.yml
Drupal\Core\DefaultContent\Importer core/core.services.yml
Drupal\Core\EventSubscriber\CsrfExceptionSubscriber core/core.services.yml
Drupal\Core\Extension\ThemeSettingsProvider core/core.services.yml
Drupal\Core\Field\FieldPreprocess core/core.services.yml Drupal\Core\Field\FieldPreprocess
Drupal\Core\File\EventSubscriber\LegacyMimeTypeMapLoadedSubscriber core/core.services.yml
Drupal\Core\File\MimeType\MimeTypeMapFactory core/core.services.yml
Drupal\Core\File\MimeType\MimeTypeMapInterface core/core.services.yml
Drupal\Core\Form\FormPreprocess core/core.services.yml Drupal\Core\Form\FormPreprocess
Drupal\Core\Mailer\EventSubscriber\OriginatorSubscriber core/modules/mailer/mailer.services.yml
Drupal\Core\Mailer\TransportServiceFactory core/modules/mailer/mailer.services.yml
Drupal\Core\Mailer\Transport\SendmailCommandValidationTransportFactory core/modules/mailer/mailer.services.yml
Drupal\Core\Menu\MenuPreprocess core/core.services.yml Drupal\Core\Menu\MenuPreprocess
Drupal\Core\Pager\PagerPreprocess core/core.services.yml Drupal\Core\Pager\PagerPreprocess
Drupal\Core\Template\ComponentsTwigExtension core/core.services.yml twig.extension
Drupal\Core\Template\IconsTwigExtension core/core.services.yml twig.extension
Drupal\Core\Template\Loader\ComponentLoader core/core.services.yml twig.loader
Drupal\Core\Template\TwigThemeEngine core/core.services.yml theme_engine
Drupal\Core\Theme\ComponentNegotiator core/core.services.yml
Drupal\Core\Theme\Component\ComponentValidator core/core.services.yml
Drupal\Core\Theme\Component\SchemaCompatibilityChecker core/core.services.yml
Drupal\Core\Theme\Icon\IconCollector core/core.services.yml needs_destruction
Drupal\Core\Theme\Icon\IconFinder core/core.services.yml
Drupal\Core\Theme\ImagePreprocess core/core.services.yml Drupal\Core\Theme\ImagePreprocess
Drupal\Core\Theme\ThemePreprocess core/core.services.yml Drupal\Core\Theme\ThemePreprocess
Drupal\database_test\EventSubscriber\DatabaseEventSubscriber core/modules/system/tests/modules/database_test/database_test.services.yml
Drupal\dblog\DbLogFilters core/modules/dblog/dblog.services.yml
Drupal\destructable_test\Destructable core/modules/system/tests/modules/destructable_test/destructable_test.services.yml needs_destruction
Drupal\file\EventSubscriber\DefaultContentSubscriber core/modules/file/file.services.yml
Drupal\file\Upload\FileUploadHandler core/modules/file/file.services.yml Alias of file.upload_handler
Drupal\file_test\EventSubscriber\DummyMimeTypeMapLoadedSubscriber core/modules/file/tests/file_test/file_test.services.yml
Drupal\fixture_manipulator\ProcessFactory core/modules/package_manager/tests/modules/fixture_manipulator/fixture_manipulator.services.yml
Drupal\fixture_manipulator\StageFixtureManipulator core/modules/package_manager/tests/modules/fixture_manipulator/fixture_manipulator.services.yml
Drupal\jsonapi_response_validator\EventSubscriber\ResourceResponseValidator core/modules/jsonapi/tests/modules/jsonapi_response_validator/jsonapi_response_validator.services.yml event_subscriber
Drupal\layout_builder\EventSubscriber\DefaultContentSubscriber core/modules/layout_builder/layout_builder.services.yml
Drupal\link\EventSubscriber\DefaultContentSubscriber core/modules/link/link.services.yml
Drupal\locale\EventSubscriber\ConfigSubscriber core/modules/locale/locale.services.yml
Drupal\locale\LocaleSource core/modules/locale/locale.services.yml
Drupal\mailer_transport_factory_kernel_test\Transport\CanaryTransportFactory core/modules/mailer/tests/modules/mailer_transport_factory_kernel_test/mailer_transport_factory_kernel_test.services.yml mailer.transport_factory
Drupal\media\EventSubscriber\DefaultContentSubscriber core/modules/media/media.services.yml
Drupal\module_installer_config_subscriber\EventSubscriber\ModuleInstallConfigTestSubscriber core/modules/system/tests/modules/module_installer_config_subscriber/module_installer_config_subscriber.services.yml
Drupal\navigation\Menu\NavigationMenuLinkTreeManipulators core/modules/navigation/navigation.services.yml
Drupal\node\NodeBulkUpdate core/modules/node/node.services.yml
Drupal\package_manager\ComposerInspector core/modules/package_manager/package_manager.services.yml
Drupal\package_manager\EventSubscriber\ChangeLogger core/modules/package_manager/package_manager.services.yml
Drupal\package_manager\EventSubscriber\DirectWriteSubscriber core/modules/package_manager/package_manager.services.yml
Drupal\package_manager\EventSubscriber\UpdateDataSubscriber core/modules/package_manager/package_manager.services.yml

Other projects


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