BeforeFlexFormConfigurationOverrideEvent
New in version 12.3
The PSR-14 event
\TYPO3\
can be used to implement a custom FlexForm override process
based on the original FlexForm configuration and the framework configuration.
Example
Registration of the event listener in the extension's Services.
:
services:
# Place here the default dependency injection configuration
MyVendor\MyExtension\Extbase\EventListener\MyEventListener:
tags:
- name: event.listener
identifier: 'my-extension/before-flexform-configuration-override'
Read how to configure dependency injection in extensions.
The corresponding event listener class:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Extbase\EventListener;
use TYPO3\CMS\Extbase\Event\Configuration\BeforeFlexFormConfigurationOverrideEvent;
final class MyEventListener
{
public function __invoke(BeforeFlexFormConfigurationOverrideEvent $event): void
{
// Configuration from TypoScript
$frameworkConfiguration = $event->getFrameworkConfiguration();
// Configuration from FlexForm
$originalFlexFormConfiguration = $event->getOriginalFlexFormConfiguration();
// Currently merged configuration
$flexFormConfiguration = $event->getFlexFormConfiguration();
// Implement custom logic
$flexFormConfiguration['settings']['foo'] = 'set from event listener';
$event->setFlexFormConfiguration($flexFormConfiguration);
}
}
API
- class BeforeFlexFormConfigurationOverrideEvent
-
- Fully qualified name
-
\TYPO3\
CMS\ Extbase\ Event\ Configuration\ Before Flex Form Configuration Override Event
Event which is dispatched before flexForm configuration overrides framework configuration. Possible core flexForm overrides have already been processed in
$flex
.Form Configuration Listeners can implement a custom flexForm override process by using the original flexForm configuration available in
$original
.Flex Form Configuration