I’m attempting to have a notification appear after a function runs in my plugin. I have the function run, and then I have the following code:
$notification = new Notification("The cache has been cleared!"); $notification->context = Notification::CONTEXT_SUCCESS; $notification->type = Notification::TYPE_TOAST; Notification\Manager::notify('General_CacheCleared', $notification); Url::redirectToReferrer();
But I’m not seeing the message appear. This plugin adds a link to the top of all screens (cacheBuster plugin), so the message would appear on any page. Is it wrong to assume that the notify() function is globally enabled, ie I should just be able to do the above ::notify and have it recognized?
If not, any idea why this message would not be appearing?