Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Session.getFlash

Session.getFlash($key, $default = '')

Description

Retrieve the one-time value of the given $key set via Session.setFlash().

The value will then be removed from the session.

If the key does not yet exist, the $default value is returned.

// (after processing user action)

Session.setFlash('message', 'Congratulations!');


// ... in the NEXT request only ...

template myTemplate() {
    -- if Session.hasFlash('message') {
        <div>{{ Session.getFlash('message') }}</div>
    -- }
}
//= <div>Congratulations!</div>