BeforeTcaOverridesEvent

New in version 13.0

A PSR-14 event \TYPO3\CMS\Core\Configuration\Event\BeforeTcaOverridesEvent enables developers to listen to the state between loaded base TCA and merging of TCA overrides.

It can be used to dynamically generate TCA and add it as additional base TCA. This is especially useful for "TCA generator" extensions, which add TCA based on another resource, while still enabling users to override TCA via the known TCA overrides API.

Example

EXT:my_extension/Configuration/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Configuration\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Configuration\Event\BeforeTcaOverridesEvent;

#[AsEventListener(
    identifier: 'my-extension/before-tca-overrides',
)]
final readonly class MyEventListener
{
    public function __invoke(BeforeTcaOverridesEvent $event): void
    {
        $tca = $event->getTca();
        $tca['tt_content']['columns']['header']['config']['max'] = 100;
        $event->setTca($tca);
    }
}
Copied!

New in version 13.0

API

class BeforeTcaOverridesEvent
Fully qualified name
\TYPO3\CMS\Core\Configuration\Event\BeforeTcaOverridesEvent

Event before $tca which later becomes $GLOBALS['TCA'] is overridden by TCA/Overrides.

Allows to manipulate $tca, before overrides are merged.

getTca ( )
Returns
array
setTca ( array $tca)
param $tca

the tca