sh/flash

Plugin to display flash messages.

v1.0 2015-04-09 17:01 UTC

This package is not auto-updated.

Last update: 2024-05-25 15:55:48 UTC


README

Build Status Scrutinizer Code Quality Code Coverage

FlashMessage

This module is used to display flash messages in your project.

To use this module the following code needs be added in the frotcontroller.

$di->setShared('flash', function() {
    $flash = new \Anax\FlashMessage\FlashMessage();
    return $flash;
});

If you want to keep the code consistent it also can be added in the CDIFactoryDefault that is located in src/DI. It should be added like this.

$this->setShared('flash', function() {
    $flash = new \Anax\FlashMessage\FlashMessage();
    return $flash;
});

To use the the flash messages add the following line to your project.

  $app->flash->message('information', 'This is a info message');
  $app->flash->message('warning', 'This is a warning message');
  $app->flash->message('success', 'This is a success message');
  $app->flash->message('error', 'This is a error message');

This will generate HTML-code that will be displayed in the view.

The style of the flash messages can be changed in the flash.css file.