Feature: #98239 - PSR-14 Event to modify form after being built
See forge#98239
Description
A new PSR-14 event
\TYPO3\
has been introduced which serves as an improved replacement for the now
removed hook
$GLOBALS.
The event provides the
$form public property.
Example
An example event listener could look like:
use TYPO3\CMS\Form\Event\AfterFormIsBuiltEvent;
class MyEventListener {
#[AsEventListener(
identifier: 'my-extension/after-form-is-built',
)]
public function __invoke(AfterFormIsBuiltEvent $event): void
{
$event->form->setLabel('foo');
}
}
Copied!
Impact
With the new
After, it's now
possible to modify the form definition after it has been built.