Skip to content

Instantly share code, notes, and snippets.

@kinglozzer
Created September 23, 2015 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinglozzer/7e21295459bc9fd7dc47 to your computer and use it in GitHub Desktop.
Save kinglozzer/7e21295459bc9fd7dc47 to your computer and use it in GitHub Desktop.
<?php
class Page extends SiteTree {
}
class Page_Controller extends ContentController {
/**
* @return ArrayData|false
*/
public function FlashMessage() {
if ($flashData = Session::get('FlashMessage')) {
Session::clear('FlashMessage');
return ArrayData::create($flashData);
}
return false;
}
}
<% if $FlashMessage %>
<% with $FlashMessage %>
<p class="message {$Type}">{$Message}</p>
<% end_with %>
<% end_if %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment