cheddam/silverstripe-flash-messages

A simple module for sending flash messages in your SilverStripe app.

Installs: 3 731

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 4

Open Issues: 0

Type:silverstripe-vendormodule

2.0.0 2019-01-23 22:18 UTC

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.