PHP code example of mercuryseries / flashy-bundle

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

    

mercuryseries / flashy-bundle example snippets


// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new MercurySeries\FlashyBundle\MercurySeriesFlashyBundle(),
        // ...
    );
}

// Method 1: via action arguments
public function create(FlashyNotifier $flashy)
{
    ...

    $flashy->success('Event created!', 'http://your-awesome-link.com');

    return $this->redirectToRoute('home');
}

// Method 2: via constructor
public function __construct(FlashyNotifier $flashy)
{
    $this->flashy = $flashy;
}

public function create()
{
    ...

    $this->flashy->success('Event created!', 'http://your-awesome-link.com');

    return $this->redirectToRoute('home');
}