dev-master
9999999-devClass for flash messages
MIT
The Development Requires
- php >=5.4
- anax/mvc dev-master
by Daniel Svensson
message flash
Class for flash messages
By Daniel Svensson, athens400@hotmail.com, (*2)
Set and get messages (error, success, notice, warning) in HTML div elements to/from session. CFormAnax is an example used with the Anax framework, (*3)
Set the CFlash service, in your frontcontroller for instance, by including the follwing:, (*4)
$di->set('message', function() use ($di) { $message = new \Ath400\Flash\CFlashAnax(); $message->setDI($di); return $message; });
CFlash does not start the session, you have to do that yourself., (*5)
Messages are set like so:, (*6)
$app->message->error('Some message'); $app->message->success('Some message'); $app->message->notice('Some message'); $app->message->warning('Some message');
Only one message is stored at a time. Meaning you only have to get one message which, depending on user action and controller responsible for calling the message methods, will output an error, success, notice or warning message., (*7)
Get the message:, (*8)
$message = $app->message-getMessage();
You can also include the stylesheet located in webroot/css-folder to give the message-boxes different colors., (*9)
This software is free software and carries a MIT license, (*10)
v1.0.0 (2015-04-29), (*11)
. ..: Copyright (c) 2015 Daniel Svensson, athens400@hotmail.com
Class for flash messages
MIT
message flash