2017 © Pedro Peláez
 

library cfmessage

Class for flash messages

image

erogami/cfmessage

Class for flash messages

  • Saturday, January 17, 2015
  • by henam1
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality Code Coverage, (*1)

Cfmessage

Flash messages, a class to show sucess, info, warning and error messages for the user., (*2)

By Alex Chau, alex_chau6@hotmail.com, (*3)

Instructions

1. Download

First of all install by using composer. Add this code to your composer.json:, (*4)

"require": {
    "erogami/cfmessage": "dev-master"
},

2. Include Cfmessage in your framework

Add this code to your front-controller., (*5)

$di->set('Cfmessage', function() use ($di) { 
    $message = new \erogami\Cfmessage\Cfmessage($di);  
    return $message; 
}); 

Now add these lines to get your message., (*6)

For info messages:, (*7)

    $app->Cfmessage->addInfo('This is an information message'); 

For error messages:, (*8)

    $app->Cfmessage->addError('This is an error message'); 

For warning messages:, (*9)

    $app->Cfmessage->addWarning('This is a warning message'); 

For success messages:, (*10)

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

The messages will be saved in the session, call these lines to print out the messages:, (*11)

    $messages = $app->Cfmessage->printMessage();
    $app->views->addString($messages);

The class uses Font Awesome, but works without it too. So it's optional wheter you want to include the icons or not., (*12)

The Versions

17/01 2015

dev-master

9999999-dev

Class for flash messages

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Alexander Chau

message notice flash info