25 lines
602 B
PHP
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,
|
|
]);
|
|
}
|
|
} |