Menu

Maslosoft Framework Logo Maslosoft Framework Documentation
Flexible Application Foundation


Flash Messages

Flash messages are meant to be used for some important result of action. For example when user successfully recovered password, or has failed to login.

These type of messages are not automatically vanishing, so use sparse. For most cases it is better to use notification messages, which vanish in few seconds after displaying.

Messages can be triggered in any place in code, whether it is normal GET or AJAX request. To create message, first instantiate FlashMessage, then call any message type.

This example message should be visible on top of page:

(new FlashMessage())->setSuccess('My success message');

Messages can also be triggered by JavaScript:

Show message
<a href="#" onclick="app.flash('My message', 'info');return false;">Show message</a>