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¶
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Extbase\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Extbase\Event\Configuration\BeforeFlexFormConfigurationOverrideEvent;
#[AsEventListener(
identifier: 'my-extension/before-flexform-configuration-override',
)]
final readonly 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);
}
}
New in version 13.0
The PHP attribute \TYPO3\
has been
introduced to tag a PHP class as an event listener. Alternatively, or if you
need to be compatible with older TYPO3 versions, you can also register an
event listener via the Configuration/
file. Switch to
an older version of this page for an example or have a look at the section
Implementing an event listener in your extension.
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 - getFrameworkConfiguration ( ) ¶
-
- Returns
-
array
- getOriginalFlexFormConfiguration ( ) ¶
-
- Returns
-
array
- getFlexFormConfiguration ( ) ¶
-
- Returns
-
array
- setFlexFormConfiguration ( array $flexFormConfiguration) ¶
-
- param $flexFormConfiguration
-
the flexFormConfiguration