<?php
namespace App\Controller;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use App\Entity\Event;
class FrontendController extends AbstractController {
/**
* @Route("/", name="homepage")
*/
public function index(EntityManagerInterface $em) {
$activeEvents = $em->getRepository(Event::class)->findBy(['active' => true], ['startDate' => 'DESC']);
return $this->render('frontend/index.html.twig', [
'activeEvents' => $activeEvents
]);
}
/**
* @Route("/contact", name="contact")
*/
public function contact() {
return $this->render('frontend/contact.html.twig');
}
}