cheddam / silverstripe-flash-messages
A simple module for sending flash messages in your SilverStripe app.
Installs: 3 712
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 4
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- php: >=5.6
- silverstripe/framework: ^4
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-10-29 05:16:37 UTC
README
for flashing dem messages
For SilverStripe 3 compatibility, use v1.0.0.
Usage
composer require cheddam/silverstripe-flash-messages
In controller methods:
$this->flashMessage('She drove me here', 'warning');
In templates:
<% if $FlashMessagesPresent %> <% loop $FlashMessages %> <div class="message message--$Type">$Message</div> <% end_loop %> <% end_if %>
Caveats
- $FlashMessages can only be called once as it clears the messages from the session before returning them.