dev-master
9999999-dev https://github.com/naess91/CFlashFlash message class for Anax-MVC
MIT
The Requires
- php >=5.4
by Erik Naess
flashmessage cflash
Wallogit.com
2017 © Pedro Peláez
Flash message class for Anax-MVC
With CFlash you can customize your own flash messages easy. With five pre defined flash message types it is very easy to install. You can also create your own personal ones., (*1)
This software is free software and carries a MIT license., (*2)
To install with Composer and Packagist:
"ernb14/cflash": "dev-master", (*3)
Firs you need to add this shared service in to your page controller., (*4)
$di->setShared('flash', function() use ($di) {
$flashmessage = new \CFlash\CFlash\CFlash();
$flashmessage->setDI($di);
return $flashmessage;
});, (*5)
Then you need to copy the images and css file in to your img and css paths. So you need to go to your theme root path like this:
cd your-theme
cp vendor/ernb14/CFlash/src/CFlash/css/CFlash.css webroot/css
cp -r vendor/ernb14/CFlash/src/CFlash/img/flash webroot/img, (*6)
Now you only have to put this out in a route:
Example message $app->flash->CustomMessage('Godkänt', 'success'); and to display the message use $messages = $app->flash->displayFlashMessages(); and $app->views->addString($messages); to retrive the messages., (*7)
This class includes five pre defined messages. And those are 'error', 'success', 'info', 'warning', 'notice'. Here is and example of how you can use one: $app->flash->CustomMessage('Felmeddelenade', 'error');, (*8)
To create a new message you can do this $app->flash->CustomMessage('Your message', 'message type'); which the type defines the css class that you can modify., (*9)
Flash message class for Anax-MVC
MIT
flashmessage cflash