Files
Projet_Symfony_Quentin/src/Controller/BaseController.php
2025-10-16 13:37:35 +02:00

25 lines
602 B
PHP

<?php
/**
* Implémente des fonctions de class "fontion répétitives"
*
* @return Response
*/
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
abstract class BaseController extends AbstractController
{
protected function renderWithData(string $template,
string $controllerName, string $msg,
array $data): Response
{
return $this->render($template, [
'controller_name' => $controllerName,
'msg' => $msg,
'tableau' => $data,
]);
}
}