O'Reilly logo

Magento 2 Developer's Guide by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Notification messages

Magento implements the notification message mechanism via the Messages module. The Messages module conforms to \Magento\Framework\Message\ManagerInterface. Though the interface itself does not impose any session relation, an implementation adds interface-defined types of messages to a session and allows access to those messages later. In the app/etc/di.xml file, there is a preference defined for \Magento\Framework\Message\ManagerInterface towards the Magento\Framework\Message\Manager class.

Message\ManagerInterface specifies four types of messages, namely error, warning, notice, and success. The types of messages are followed by several key methods in the Message\Manager class, such as addSuccess, addNotice, addWarning,

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required