Feature: #97595 - Provide default queue for notifications¶
See forge#97595
Description¶
To allow dispatching notifications to the user the easy way, a new global flash
message queue, identified by
TYPO3\
, is
introduced that takes the flash message and renders it as a notification on the
top-right edge of the backend.
Backend modules based on \TYPO3\
automatically gain advantage of this feature.
Example¶
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$notificationQueue = $flashMessageService->getMessageQueueByIdentifier(
FlashMessageQueue::NOTIFICATION_QUEUE
);
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
'I\'m a message rendered as notification',
'Hooray!',
FlashMessage::OK
);
$notificationQueue->enqueue($flashMessage);
Copied!
Impact¶
All flash messages dispatched to the flash message queue
Flash
will be rendered as notifications
in the browser.