Flash messages renderer
The implementation of rendering FlashMessages in the Core has been optimized.
A new class called \TYPO3\
has been introduced. This class detects the context and renders the given
FlashMessages in the correct output format.
It can handle any kind of output format.
The Core ships with the following FlashMessageRenderer classes:
\TYPO3\
This renderer is used by default in the TYPO3 backend. The output is based on Bootstrap markup.CMS\ Core\ Messaging\ Renderer\ Bootstrap Renderer \TYPO3\
This renderer is used by default in the TYPO3 frontend. The output is a simpleCMS\ Core\ Messaging\ Renderer\ List Renderer <ul>
list.\TYPO3\
This renderer is used by default in the CLI context. The output is plain text.CMS\ Core\ Messaging\ Renderer\ Plaintext Renderer
All new rendering classes have to implement the \TYPO3\
interface.
If you need a special output format, you can implement your own renderer class and use it:
use TYPO3\CMS\Core\Utility\GeneralUtility;
use MyVendor\SomeExtension\Messaging\MySpecialRenderer;
$out = GeneralUtility::makeInstance(MySpecialRenderer::class)
->render($flashMessages);
The Core has been modified to use the new Flash
.
Any third party extension should use the provided Flash
or the new Flash
class:
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Messaging\FlashMessageRendererResolver;
$out = GeneralUtility::makeInstance(FlashMessageRendererResolver::class)
->resolve()
->render($flashMessages);