PHP code example of calgus / flash

1. Go to this page and download the library: Download calgus/flash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

calgus / flash example snippets


$di->set('flash', function() use ($di) {
    $flash = new \Anax\FlashMessages\CFlashBasic();
    $flash->setDI($di);
    return $flash;
});

$di->set('FlashController', function() use ($di) {
    $flashController = new \Anax\FlashMessages\FlashController();
    $flashController->setDI($di);
    return $flashController;
});

$messages = $this->flash->getSessionMessageClean();
foreach ($messages as $index => $value) {
    $type = $value['type'];
    $message = $value['message'];
}