Feature: #99055 - BackendController service tag attribute

See forge#99055

Description

A new PHP attribute TYPO3\CMS\Backend\Attribute\AsController has been added in order to register services to the BackendController dependency injection container.

Note

In early TYPO3 v12 versions the attribute was named #[Controller] and has later been renamed to #[AsController]. Both work with TYPO3 v12, but developers should use #[AsController] for upwards compatibility since #[Controller] has been deprecated with TYPO3 v13.

In addition to tag backend.controller in the Services.yaml file, tagging services as backend controller can be done like:

Example implementation

use TYPO3\CMS\Backend\Attribute\AsController;

#[AsController]
class MyBackendController {

}

Impact

It is now possible to tag services as backend controller by the PHP attribute TYPO3\CMS\Backend\Attribute\AsController instead of tagging them with backend.controller in the Services.yaml file.