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

29 lines
763 B
PHP
Raw Normal View History

2021-04-22 17:44:16 +02:00
<?php
namespace App\Controller;
2021-04-26 17:31:24 +02:00
use App\Repository\OfferingRepository;
2021-04-30 17:08:34 +02:00
use Doctrine\ORM\EntityManagerInterface;
2021-04-22 17:44:16 +02:00
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2021-04-30 17:08:34 +02:00
use Symfony\Component\HttpFoundation\Request;
2021-04-22 17:44:16 +02:00
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
2021-04-26 17:31:24 +02:00
use Twig\Environment;
2021-04-22 17:44:16 +02:00
class AppController extends AbstractController
{
2021-04-30 17:08:34 +02:00
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
2021-05-09 11:20:45 +02:00
#[Route('/', name: 'homepage')]
public function index(Environment $twig, OfferingRepository $offerRepository): Response
{
return new Response($twig->render('app/index.html.twig'));
}
2021-04-22 17:44:16 +02:00
}