EnhanceStdWrapEvent 

Listeners to the PSR-14 event \TYPO3\CMS\Frontend\ContentObject\Event\EnhanceStdWrapEvent are able to modify the stdWrap processing, enhancing the functionality and manipulating the final result/content. This is the parent event, which allows the corresponding listeners to be called on each step.

Child events:

All events provide the same functionality. The difference is only the execution order in which they are called in the stdWrap processing chain.

Example: Listen to one, several, or all stdWrap events 

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\AfterStdWrapFunctionsExecutedEvent;
use TYPO3\CMS\Frontend\ContentObject\Event\AfterStdWrapFunctionsInitializedEvent;
use TYPO3\CMS\Frontend\ContentObject\Event\BeforeStdWrapFunctionsInitializedEvent;
use TYPO3\CMS\Frontend\ContentObject\Event\EnhanceStdWrapEvent;

#[AsEventListener(
  identifier: 'my-extension/my-stdwrap-enhancement',
)]
final readonly class MyEventListener
{
  public function __invoke(EnhanceStdWrapEvent $event): void
  {
    // listen to all events
  }

  #[AsEventListener(
    identifier: 'my-extension/my-stdwrap-before-initialized',
  )]
  public function individualListener(BeforeStdWrapFunctionsInitializedEvent $event): void
  {
    // listen on BeforeStdWrapFunctionsInitializedEvent only
  }

  #[AsEventListener(
    identifier: 'my-extension/my-stdwrap-after-initialized-executed',
  )]
  public function listenOnMultipleEvents(
    AfterStdWrapFunctionsInitializedEvent|AfterStdWrapFunctionsExecutedEvent $event,
  ): void {
    // Union type to listen to different events
  }
}
Copied!

API 

abstract class EnhanceStdWrapEvent
Fully qualified name
\TYPO3\CMS\Frontend\ContentObject\Event\EnhanceStdWrapEvent

Listeners to this Event are able to modify the stdWrap processing, enhancing the functionality and manipulating the final result / content. This is the parent Event, which allows the corresponding listeners to be called on each step, see child Events:

getContent()
Returns
?string
setContent(string $content)
param $content

the content

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