Feature: #89066 - Add PHP API for Notifications in backend¶
See Issue #89066
NotificationService is responsible for generating notifications (not FlashMessages)
top right corner of the TYPO3 backend.
The scope of this API is backend only! If you need something similar for the frontend or in CLI
context, the FlashMessage API is your friend or you have to implement your own logic.
A simple notification of type notice:
GeneralUtility::makeInstance(NotificationService::class) ->notice('Notice', 'notice');
A notification of type warning with two buttons:
GeneralUtility::makeInstance(NotificationService::class) ->warning('Warning', 'Are you sure you want delete this record?', 0, [ new Action('Yes', '... some JS code here ...'), new Action('No', '... some JS code here ...', Action::TYPE_DEFERRED), ]);