PHP code example of ajt / flashbundle

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

    

ajt / flashbundle example snippets


class MyClass
{

    private $flash;

    public function __construct(FlashInterface $flash)
    {
        $this->flash = $flash;
    }

    public function goThings()
    {
        ...
        $this->flash->success("Well done");
    }
}

// Set a custom type

$flash->set('my message', 'myType');

// Bootstrap
$flash->success('my message');
$flash->error('my message');
$flash->info('my message');
$flash->warning('my message');
Twig
{{ ajt_flash('error') }}