Feature: #78477 - Refactoring of FlashMessage rendering
See forge#78477
Description
The implementation of rendering FlashMessages in the core has been optimized. With forge#73698 a cleanup has been started to centralize the markup within the FlashMessage class.
A new class called Flash
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 following FlashMessageRendererResolver classes have been introduced:
\TYPO3\
(is used in backend context by default)CMS\ Core\ Messaging\ Renderer\ Bootstrap Renderer \TYPO3\
(is used in frontend context by default)CMS\ Core\ Messaging\ Renderer\ List Renderer \TYPO3\
(is used in CLI context by default)CMS\ Core\ Messaging\ Renderer\ Plaintext Renderer
All new rendering classes have to implement the \TYPO3\
interface.
Impact
The core has been modified to use the new Flash
.
Any third party extension should use the provided Flash
or the new Flash
class:
$out = GeneralUtility::makeInstance(FlashMessageRendererResolver::class)
->resolve()
->render($flashMessages);