Services - 8.9.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 893

Title File name Summary All service tags
router core/core.services.yml Drupal\Core\Routing\AccessAwareRouter
router.admin_context core/core.services.yml Drupal\Core\Routing\AdminContext
router.builder core/core.services.yml Drupal\Core\Routing\RouteBuilder needs_destruction
router.dumper core/core.services.yml Drupal\Core\Routing\MatcherDumper backend_overridable
router.dynamic core/core.services.yml Symfony\Cmf\Component\Routing\DynamicRouter service_collector
router.matcher core/core.services.yml Symfony\Cmf\Component\Routing\NestedMatcher\NestedMatcher service_collector
router.matcher.final_matcher core/core.services.yml Drupal\Core\Routing\UrlMatcher
router.no_access_checks core/core.services.yml \Drupal\Core\Routing\Router service_collector
router.path_roots_subscriber core/core.services.yml Drupal\Core\EventSubscriber\PathRootsSubscriber event_subscriber
router.request_context core/core.services.yml Drupal\Core\Routing\RequestContext persist
router.route_preloader core/core.services.yml Drupal\Core\Routing\RoutePreloader event_subscriber
router.route_provider core/core.services.yml Drupal\Core\Routing\RouteProvider event_subscriber, backend_overridable
router.route_provider.lazy_builder core/core.services.yml Drupal\Core\Routing\RouteProviderLazyBuilder event_subscriber
router_listener core/core.services.yml Symfony\Component\HttpKernel\EventListener\RouterListener event_subscriber
route_access_response_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RouteAccessResponseSubscriber event_subscriber
route_enhancer.entity core/core.services.yml Drupal\Core\Entity\Enhancer\EntityRouteEnhancer route_enhancer
route_enhancer.entity_revision core/core.services.yml Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer route_enhancer
route_enhancer.form core/core.services.yml Drupal\Core\Routing\Enhancer\FormRouteEnhancer route_enhancer
route_enhancer.param_conversion core/core.services.yml Drupal\Core\Routing\Enhancer\ParamConversionEnhancer route_enhancer, event_subscriber
route_http_method_subscriber core/core.services.yml Drupal\Core\EventSubscriber\RouteMethodSubscriber event_subscriber
route_processor_csrf core/core.services.yml Drupal\Core\Access\RouteProcessorCsrf route_processor_outbound
route_processor_current core/core.services.yml Drupal\Core\RouteProcessor\RouteProcessorCurrent route_processor_outbound
route_processor_manager core/core.services.yml Drupal\Core\RouteProcessor\RouteProcessorManager service_collector
route_special_attributes_subscriber core/core.services.yml Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber event_subscriber
route_subscriber.entity core/core.services.yml Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber event_subscriber
route_subscriber.module core/core.services.yml Drupal\Core\EventSubscriber\ModuleRouteSubscriber event_subscriber
route_subscriber.no_big_pipe core/modules/big_pipe/big_pipe.services.yml Drupal\big_pipe\EventSubscriber\NoBigPipeRouteAlterSubscriber event_subscriber
search.index core/modules/search/search.services.yml Drupal\search\SearchIndex
search.search_page_repository core/modules/search/search.services.yml Drupal\search\SearchPageRepository
serialization.bc_config_subscriber core/modules/serialization/serialization.services.yml Drupal\serialization\EventSubscriber\BcConfigSubscriber event_subscriber
serialization.entity_resolver.target_id core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\TargetIdResolver entity_resolver
serialization.exception.default core/modules/serialization/serialization.services.yml Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber event_subscriber
serialization.json core/core.services.yml Drupal\Component\Serialization\Json
serialization.normalizer.field core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\FieldNormalizer normalizer
serialization.normalizer.field_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\FieldItemNormalizer normalizer
serialization.phpserialize core/core.services.yml Drupal\Component\Serialization\PhpSerialize
serialization.user_route_alter_subscriber core/modules/serialization/serialization.services.yml Drupal\serialization\EventSubscriber\UserRouteAlterSubscriber event_subscriber
serialization.yaml core/core.services.yml Drupal\Component\Serialization\Yaml
serializer core/modules/serialization/serialization.services.yml Symfony\Component\Serializer\Serializer
serializer.encoder.hal core/modules/hal/hal.services.yml Drupal\hal\Encoder\JsonEncoder encoder
serializer.encoder.json core/modules/serialization/serialization.services.yml Drupal\serialization\Encoder\JsonEncoder encoder
serializer.encoder.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Encoder\JsonEncoder jsonapi_encoder
serializer.encoder.serialization_test core/modules/serialization/tests/serialization_test/serialization_test.services.yml Drupal\serialization_test\SerializationTestEncoder encoder
serializer.encoder.xml core/modules/serialization/serialization.services.yml Drupal\serialization\Encoder\XmlEncoder encoder
serializer.entity_resolver core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\ChainEntityResolver
serializer.entity_resolver.uuid core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\UuidResolver entity_resolver
serializer.normalizer.boolean.datatype.emoji core/modules/serialization/tests/modules/test_datatype_boolean_emoji_normalizer/test_datatype_boolean_emoji_normalizer.services.yml Drupal\test_datatype_boolean_emoji_normalizer\Normalizer\BooleanNormalizer normalizer
serializer.normalizer.boolean.fieldtype.emoji core/modules/serialization/tests/modules/test_fieldtype_boolean_emoji_normalizer/test_fieldtype_boolean_emoji_normalizer.services.yml Drupal\test_fieldtype_boolean_emoji_normalizer\Normalizer\BooleanItemNormalizer normalizer
serializer.normalizer.complex_data core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\ComplexDataNormalizer normalizer
serializer.normalizer.config_entity core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\ConfigEntityNormalizer normalizer

Other projects


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