Services.yaml¶
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
A typical Configuration/Services.yaml
may look like this:
services:
# general settings
_defaults:
autowire: true
autoconfigure: true
public: false
TYPO3\CMS\Core\:
resource: '../Classes/*'
# dependency injection (override public setting)
TYPO3\CMS\Core\Mail\Mailer:
public: true
TYPO3\CMS\Core\Command\SendEmailCommand:
tags:
- name: 'console.command'
command: 'mailer:spool:send'
- name: 'console.command'
command: 'swiftmailer:spool:send'
alias: true
schedulable: false
Copied!
See also
- TYPO3 uses the Symfony Dependency Injection component, so official documentation can be found at https://symfony.com/doc/current/service_container.html