rentaswag / silverstripe-flash-messages
A simple module for sending flash messages in your SilverStripe app.
Installs: 92
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 4
Open Issues: 1
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: 2020-09-30 02:05: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.