<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use App\Repository\UserPlatformRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
use App\Acme\Bundle\Utility\ViewUtility\UtilityMenusBackend;
use App\Acme\Bundle\Utility\TemplatesUtility\MenusStandard;
use App\Form\SubscriptionForm\UserMultilType;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use App\Entity\UserPlatform;
use App\Entity\TypeOne;
use App\Service\ExcelExporter;
class HomeController extends AbstractController
{
/**
* @Route("/", name="app_home")
*/
public function index(EntityManagerInterface $entityManager): Response
{
return $this->redirectToRoute('app_product_back_new', [], Response::HTTP_SEE_OTHER);
}
/**
* @Route("/template-login", name="app_template_login")
*/
public function templatesLogin(EntityManagerInterface $entityManager): Response
{
return $this->render('backView/templates_login.html.twig', [
]);
}
/**
* @Route("/template-administration", name="app_template_admin")
*/
public function templatesAdmin(EntityManagerInterface $entityManager): Response
{
/*return $this->render('backView/templates_admin.html.twig', [
]);*/
return $this->render('backView/templates_admin_two.html.twig', [
]);
}
/**
* @Route("/export-excel", name="app_template_export")
*/
public function exportToExcel(): Response
{
$headers = ['Header 1', 'Header 2', 'Header 3'];
// Simuler des données de la table
$data = [
['Data 1', 'Data 2', 'Data 3'],
['Data 4', 'Data 5', 'Data 6'],
// Ajoutez vos données ici...
];
// Exporter les données vers un fichier Excel
ExcelExporter::exportTableToExcel($headers, $data, 'exported_data.xlsx');
return new Response();
}
/**
* @Route("/access-denied", name="app_home_access_denied")
*/
public function accesDenied(EntityManagerInterface $entityManager): Response
{
return $this->render('security/error403.html.twig', [
]);
}
}