---
title: "Services.yaml"
manual: "TYPO3 Explained"
version: "12.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:extension-configuration-services-yaml@12.4"
source: "ExtensionArchitecture/FileStructure/Configuration/ServicesYaml.rst"
rendered: "2026-10-21T15:29:37+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v12 has reached end-of-life as of April 30th 2026 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# `Services.yaml` {#extension-configuration-services-yaml}

It is possible to use a YAML or PHP format:

-   **Services.yaml**

    -   *Scope:* extension
    -   *Path (Composer):* packages/my_extension/Configuration/Services.yaml
    -   *Path (Classic):* typo3conf/ext/my_extension/Configuration/Services.yaml

-   **Services.php**

    -   *Scope:* extension
    -   *Path (Composer):* packages/my_extension/Configuration/Services.php
    -   *Path (Classic):* typo3conf/ext/my_extension/Configuration/Services.php

Services can be configured in this file. TYPO3 uses it for:

-   [Dependency Injection](https://docs.typo3.org/permalink/t3coreapi:configure-dependency-injection-in-extensions@12.4)
-   [Event Listeners](https://docs.typo3.org/permalink/t3coreapi:eventdispatcherregistration@12.4)
-   Command Controllers (see [Feature: #89139 - Add dependency injection
    support for console commands](https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.3/Feature-89139-AddDependencyInjectionSupportForConsoleCommands.html))
-   [Registering a widget with the dashboard](https://docs.typo3.org/c/typo3/cms-dashboard/12.4/en-us/Configuration/WidgetRegistration.html#register-new-widget)

**EXT:my_extension/Configuration/Services.yaml**

```yaml
services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  T3docs\Examples\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'

  MyVendor\MyExtension\LinkValidator\LinkType\ExampleLinkType:
    tags:
      -  name: linkvalidator.linktype

```
