PHP code example of webiik / flash

1. Go to this page and download the library: Download webiik/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/ */

    

webiik / flash example snippets


$flash = new \Webiik\Flash\Flash($session);
$flash->addFlashCurrent('inf', 'Hello {name}', ['name' => 'Dolly']);
$flash->addFlashNext('inf', 'Hello {name}', ['name' => 'Molly']);
print_r($flash->getFlashes()); // Array ([inf] => Array ([0] => Hello Dolly ))

$flash = new \Webiik\Flash\Flash($session);
print_r($flash->getFlashes()); // Array ([inf] => Array ([0] => Hello Molly ))

setLang(string $lang): void

$flash->setLang('en');

addFlashCurrent(string $type, string $message, array $context = []): void

$flash->addFlashCurrent('inf', 'Hello {name}', ['name' => 'Dolly']);

addFlashNext(string $type, string $message, array $context = []): void

$flash->addFlashNext('inf', 'Hello {name}', ['name' => 'Molly']);

getFlashes(): array

$flashMessages = $flash->getFlashes();