Services.yaml
It is possible to use a YAML or PHP format:
Configuration/Services.yaml
-
- Scope
- extension
- Path (Composer)
- packages/my_extension/Configuration/Services.yaml
- Path (Classic)
- typo3conf/ext/my_extension/Configuration/Services.yaml
Configuration/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
- Event Listeners
- Command Controllers (see Feature: #89139 - Add dependency injection support for console commands)
- Registering a widget with the dashboard
EXT:my_extension/Configuration/Services.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
See also
- TYPO3 uses the Symfony Dependency Injection component. The official documentation can be found at https://symfony.com/doc/current/service_container.html
- It is possible to use a glob pattern for the file paths, for example
'../
.Classes/*'