|
|
@ -10,15 +10,10 @@ class FrontControleur
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
session_start();
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
|
|
|
|
//var_dump($_SESSION['utilisateur']);
|
|
|
|
//var_dump($_SESSION['utilisateur']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($_SESSION['utilisateur'] != NULL) {
|
|
|
|
if ($_SESSION['utilisateur'] != NULL) {
|
|
|
|
// echo on y passe
|
|
|
|
// echo on y passe
|
|
|
|
$twig->addGlobal('nom', $_SESSION['utilisateur']->getNom());
|
|
|
|
$twig->addGlobal('nom', $_SESSION['utilisateur']->getNom());
|
|
|
@ -66,12 +61,8 @@ class FrontControleur
|
|
|
|
$action = $match['params']['action'] ?? NULL;
|
|
|
|
$action = $match['params']['action'] ?? NULL;
|
|
|
|
$id = $match['params']['id'] ?? NULL;
|
|
|
|
$id = $match['params']['id'] ?? NULL;
|
|
|
|
|
|
|
|
|
|
|
|
//var_dump($match);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$namespace = 'App\\controleur\\';
|
|
|
|
$namespace = 'App\\controleur\\';
|
|
|
|
|
|
|
|
|
|
|
|
echo "action: ".$action;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if ($controller == "MembreControleur") {
|
|
|
|
if ($controller == "MembreControleur") {
|
|
|
|
|
|
|
|
|
|
|
@ -104,14 +95,11 @@ class FrontControleur
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($controller == "UtilisateurControleur")
|
|
|
|
if($controller == "UtilisateurControleur")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$controller = $namespace . $controller;
|
|
|
|
$controller = $namespace . $controller;
|
|
|
|
$controller = new $controller();
|
|
|
|
$controller = new $controller();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (is_callable(array($controller, $action))) {
|
|
|
|
if (is_callable(array($controller, $action))) {
|
|
|
|
echo "action callable";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call_user_func(array($controller, $action), $match['params']);
|
|
|
|
call_user_func(array($controller, $action), $match['params']);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -124,8 +112,6 @@ class FrontControleur
|
|
|
|
} catch (Error $error) {
|
|
|
|
} catch (Error $error) {
|
|
|
|
$dVueErreur = ['Erreur : Action inconnue'];
|
|
|
|
$dVueErreur = ['Erreur : Action inconnue'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
|
|
|
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|