2017 © Pedro Peláez
 

silverstripe-module silverstripe-flashmessage

Easy flash messages for Silverstripe

image

axyr/silverstripe-flashmessage

Easy flash messages for Silverstripe

  • Wednesday, May 4, 2016
  • by axyr
  • Repository
  • 1 Watchers
  • 1 Stars
  • 245 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

silverstripe-flashmessage

Scrutinizer Packagist Packagist, (*1)

Display simple one-time flash message with Twitter Bootstrap or Zurb Foundation markup., (*2)

    public function submitForm($data, Form $form)
    {
        $form->saveInto($this->record);
        $this->record->write();

        Flash::success('Form saved');

        return $this->controller->redirect($this->controller->Link());
    }

Installation

$ composer require axyr/silverstripe-flashmessage

Add the template variable $FlashMessage to your Page template where you wish the flash dialog to appear., (*3)

Usage

The FlashMessage template has all the markup and attributes so that it will play nicely with the Twitter Bootstrap and Zurb Foundation frameworks., (*4)

http://getbootstrap.com/components/#alerts, (*5)

http://foundation.zurb.com/sites/docs/callout.html, (*6)

You can set a colored flash message with te following methods:, (*7)

Flash::info('Some message');
Flash::success('Some message');
Flash::warning('Some message');
Flash::danger('Some message'); // Bootstrap
Flash::alert('Some message'); // Foundation

By default the message will be closable, but this can be disabled. You can also set the message to automaticly fadeout., (*8)

For this to work, we assume jQuery is used and the flashmessage.js file is added to the Requirements::javascript();, (*9)

Flash::success('You cannot close me', false);
Flash::success('I will fade out', false, true);

You can also show the message in a modal window :, (*10)

Flash::modal('Some message');

Config

FlashMessage:
   defaults:
     Type: success
     Closable: true
     FadeOut: false
   supported_methods:
     - info
     - success
     - warning
     - danger
     - alert
     - modal
   template: FlashMessage
   session_name: FlashMessage
   load_javascript: true

The Versions

04/05 2016

dev-master

9999999-dev

Easy flash messages for Silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

twitter bootstrap silverstripe message session flash zurb foundation

04/05 2016

0.0.2

0.0.2.0

Easy flash messages for Silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

twitter bootstrap silverstripe message session flash zurb foundation

28/04 2016

0.0.1

0.0.1.0

Easy flash messages for Silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

twitter bootstrap silverstripe message session flash zurb foundation