You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously my flash messages would use the types of info / error etc to display flash messages using different colour schemes (e.g. red alert panel for error messages, light green for success notifications), but this no longer appears to be supported.
I think it would be nice to be able to set the flash message "type" based on the importance value of the notification option.
Can I get some feedback on whether this is a good idea, before I put together a PR?
Presumably the only necessary modification would just be to use the importance string as the flash message type - e.g.
…ype (benr77, fabpot)
This PR was merged into the 6.1 branch.
Discussion
----------
[Notifier] Use Importance level to set flash message type
| Q | A
| ------------- | ---
| Branch? | 6.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#43187
| License | MIT
Instead of hard-coding the flash message type, set the flash message type based on the "importance" level of the notification.
Commits
-------
1904fed Add missing dep
7ce1b9c [Notifier] Add Importance level to flash message type
I've just implemented browser flash messages using the Notifier component. Works well and easy to set up.
However, the first thing I noticed is that the "type" for the flash message is hard-coded to
notification
symfony/src/Symfony/Component/Notifier/Channel/BrowserChannel.php
Line 40 in 6b1d9b8
Previously my flash messages would use the types of
info
/error
etc to display flash messages using different colour schemes (e.g. red alert panel for error messages, light green for success notifications), but this no longer appears to be supported.I think it would be nice to be able to set the flash message "type" based on the importance value of the notification option.
Can I get some feedback on whether this is a good idea, before I put together a PR?
Presumably the only necessary modification would just be to use the importance string as the flash message type - e.g.
$request->getSession()->getFlashBag()->add($notification->getImportance(), $message);
The text was updated successfully, but these errors were encountered: