2017 © Pedro Peláez
 

library cflash

Flash message class for Anax-MVC

image

ernb14/cflash

Flash message class for Anax-MVC

  • Monday, December 1, 2014
  • by naess91
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

CFlash 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)

License

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

Installation

To install with Composer and Packagist:
"ernb14/cflash": "dev-master", (*3)

How to use flash messages

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)

Pre defined messages

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)

The Versions

01/12 2014

dev-master

9999999-dev https://github.com/naess91/CFlash

Flash message class for Anax-MVC

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Erik Naess

flashmessage cflash