AfterContentObjectRendererInitializedEvent

New in version 13.0

The PSR-14 event \TYPO3\CMS\Frontend\ContentObject\Event\AfterContentObjectRendererInitializedEvent is being dispatched after the ContentObjectRenderer has been initialized in its start() method.

Example

EXT:my_extension/Classes/Frontend/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Frontend\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Frontend\ContentObject\Event\AfterContentObjectRendererInitializedEvent;

#[AsEventListener(
    identifier: 'my-extension/my-event-listener',
)]
final readonly class MyEventListener
{
    public function __invoke(AfterContentObjectRendererInitializedEvent $event): void
    {
        $event->getContentObjectRenderer()->setCurrentVal('My current value');
    }
}
Copied!

New in version 13.0

API

class AfterContentObjectRendererInitializedEvent
Fully qualified name
\TYPO3\CMS\Frontend\ContentObject\Event\AfterContentObjectRendererInitializedEvent

Listeners are able to modify the initialized ContentObjectRenderer instance

getContentObjectRenderer ( )
Returns
\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer