Wallogit.com
2017 © Pedro Peláez
small PHP module for sending/getting flash messages
PHP class for sending/recieving flash messages (notices, errors etc.) through use of a session., (*1)
To get started, follow these steps after installing CFlash through Composer., (*2)
Step 1. In your vendor/jonahe/cflash/webroot folder, locate the two files (cflash_anax.php, cflash_anax_redirect.php) and copy them to your own webroot folder. These files show how to use CFlashAnax., (*3)
Step 2. In your vendor/jonahe/cflash/src/Flash folder, locate the class file (CFlashAnax.php) and copy it to your Anax/src/Flash folder., (*4)
Step 3. In your vendor/jonahe/cflash/webroot/css folder, locate the css file (flash.css) and copy it to your webroot/css folder., (*5)
Step 4. Point your webbrowser to cflash_anax.php. It should set three test messages through the use of CFlashAnax, then do a redirect to the file cflash_anax_redirect.php where the messages will be shown., (*6)
Note that CFlashAnax makes use of Anax MVC's CSession (session handler). This service is automatically available to CFlashAnax through dependency injection., (*7)
For a simpler version, not dependent on the Anax framework or CSession: Use the class CFlashSimple instead. The API/interface to this class is the same as with CFlashAnax., (*8)
Exampel code of this approach is found in cflash_simple.php, (*9)