<?php
namespace App\Controller;
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\Persistence\ManagerRegistry;
use App\Entity\ReaPrint;
use App\Entity\TypeSecteur;
use App\Entity\TypeSupport;
class ReaPrintController extends AbstractController
{
/**
* @Route("/rea_print", name="rea_print")
*/
public function index(ManagerRegistry $doctrine): Response
{
// try {
// $bdd = new \PDO('mysql:host=localhost;dbname=c1stage2;charset=utf8', 'c1stage', 'xZmAh!o89D');
// } catch (Exception $e) {
// die('Erreur : ' . $e->getMessage());
// }
$em = $doctrine->getManager();
$realisations = $em->getRepository(ReaPrint::class)->findAll();
$secteurs = $em->getRepository(TypeSecteur::class)->findAll();
$supports = $em->getRepository(TypeSupport::class)->findAll();
return $this->render('rea_print/index.html.twig', [
'realisations' => $realisations,
'secteurs' => $secteurs,
'supports' => $supports,
'controller_name' => 'ReaPrintController',
]);
}
}