pflaenz.li-Symfony/src/Controller/AppController.php

28 lines
763 B
PHP

<?php
namespace App\Controller;
use App\Repository\OfferingRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Twig\Environment;
class AppController extends AbstractController
{
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
#[Route('/', name: 'homepage')]
public function index(Environment $twig, OfferingRepository $offerRepository): Response
{
return new Response($twig->render('app/index.html.twig'));
}
}