2017 © Pedro Peláez
 

library cmessage

Class to show flash messages

image

isa/cmessage

Class to show flash messages

  • Saturday, December 13, 2014
  • by emm14
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Alt text, (*1)

CMessage

Module for session-based Flash Messages that handels messages for error, success and information. If you are using Anax/MVC use the class CMessageAnax., (*2)

License

This software is free software and carries a MIT license., (*3)

How to use

Session must be started before including CMessage., (*4)

Include CMessage by adding this lines:, (*5)

$di->set('message', function() {
    $message = new \Isa\CMessage\CMessage();
    return $message;
});

If you are using Anax/MVC include CMessage with this lines:, (*6)

$di->set('message', function() use ($di) {
    $message = new \Isa\CMessage\CMessageAnax($di);
    return $message;
});

Simply add the desired messages by adding these lines:, (*7)

For error-messages:, (*8)

$app->message->addErrorMessage('This is a error-message');

For success-messages:, (*9)

$app->message->addSuccessMessage('This is a success-message');

For information-messages:, (*10)



This lines will save the message/messages in the session and when you want to print out the messages call the method printMessage:, (*11)

$app->message->printMessage();

For example you could place the messages in a variable like this:, (*12)

$messages = $app->message->printMessage();

and then use this line to print it out on a page:, (*13)

$app->views->addString($messages); 

The messages are using icons from Font Awesome. If you want to include icons in your messages just download Font Awesome from http://fortawesome.github.io/Font-Awesome/ and place it in your project. Then make the project use the css-file, for example like this:, (*14)

$app->theme->addStylesheet('css/font-awesome/css/font-awesome.css');

If you dont want to use the icons the messages will look fine even without them., (*15)

The Versions

13/12 2014

dev-master

9999999-dev

Class to show flash messages

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Emma Malmkjell

message flash