diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index 55670d4..30cf2ac 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -53,6 +53,9 @@ class AppController extends AbstractController $this->entityManager->persist($offering); $this->entityManager->flush(); + + $this->addFlash("success", "Successfully added the new offering!"); + return $this->redirectToRoute('homepage'); } return $this->render('app/new_listing.html.twig', [ diff --git a/templates/app/index.html.twig b/templates/app/index.html.twig index bce6b12..881c486 100644 --- a/templates/app/index.html.twig +++ b/templates/app/index.html.twig @@ -2,6 +2,12 @@ {% block body %} + {% for message in app.flashes('success') %} + + {% endfor %} +

Offerings

{% if offerings|length > 0 %}