Skip to content

Instantly share code, notes, and snippets.

@ahmed-bhs
Created October 4, 2018 00:57
Show Gist options
  • Save ahmed-bhs/0a758053318a15130cfbb0a92854f7c8 to your computer and use it in GitHub Desktop.
Save ahmed-bhs/0a758053318a15130cfbb0a92854f7c8 to your computer and use it in GitHub Desktop.
<?php
namespace App\Controller;
use App\Message\SendNotification;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController
{
/**
* @Route("/", name="home")
*/
public function index(MessageBusInterface $bus)
{
$bus->dispatch(new SendNotification('notification', ['[email protected]', '[email protected]']));
return $this->render('home/index.html.twig');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment