diff --git a/cache/b8/b8bf2b0d7583c567fbc28aec381ed411.php b/cache/b8/b8bf2b0d7583c567fbc28aec381ed411.php
new file mode 100644
index 0000000..164ff94
--- /dev/null
+++ b/cache/b8/b8bf2b0d7583c567fbc28aec381ed411.php
@@ -0,0 +1,150 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+

env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["srcImg"] ?? null), "html", null, true);
+ yield "\" alt=\"";
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nameCarac"] ?? null), "html", null, true);
+ yield "\">
+
+
+ ";
+ // line 7
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["quoteContent"] ?? null), "html", null, true);
+ yield "
+
+
+
+ -
+ ";
+ // line 12
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["sourceName"] ?? null), "html", null, true);
+ yield "
+
+ -
+ ";
+ // line 15
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nameCarac"] ?? null), "html", null, true);
+ yield "
+
+ -
+ ";
+ // line 18
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["dateSortie"] ?? null), "html", null, true);
+ yield "
+
+
+
+
+ ";
+ // line 23
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nbLike"] ?? null), "html", null, true);
+ yield "
+
+
+
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "quote.html";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 116 => 34, 112 => 32, 104 => 31, 99 => 30, 95 => 29, 91 => 28, 83 => 23, 75 => 18, 69 => 15, 63 => 12, 55 => 7, 47 => 4, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "quote.html", "/home/www/kekentin/public_html/WF/WF-Website/vue/templates/quote.html");
+ }
+}
diff --git a/config/config.php b/config/config.php
index 044d3ec..3caadec 100644
--- a/config/config.php
+++ b/config/config.php
@@ -16,6 +16,7 @@ $mdp = '';
//Vues
$vues['erreur'] = 'vue/erreur.php';
$vues['accueil'] = 'vue/accueil.php';
+$vues['quote'] = 'vue/quote.php';
//Style css
$style['accueil'] = 'public/styles/styleAccueil.css';
diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php
index 6c4eac5..40d8f9c 100644
--- a/src/Controleur/FrontControler.php
+++ b/src/Controleur/FrontControler.php
@@ -3,20 +3,23 @@ namespace Controleur;
Class FrontControler{
- private $listAction = ['visitor' => array('accueil','search','quote','login','singin'),
- 'user' => array('quiz','commentary','favorite','logout'),
- 'admin' => array()];
+ private $listAction;
private string $role = 'visitor';
public function __construct(){
global $twig;
+ $this->listAction = ['visitor' => array('accueil','search','quote','login','singin'),
+ 'user' => array('quiz','commentary','favorite','logout'),
+ 'admin' => array('null')];
+
$dVueEreur = [];
$router = new \AltoRouter();
$router->map('GET', '/', 'VisitorControler');
+
/*
'i' => '[0-9]++'
'a' => '[0-9A-Za-z]++'
@@ -25,11 +28,11 @@ Class FrontControler{
'**' => '.++'
'' => '[^/\.]++'
*/
- $router->map('GET|POST', '/quote/[a:action]?', 'VisitorControler');
- $match = $router->match();
+ $router->map('GET|POST', '/quote/[i:arg]?', 'VisitorControler');
- $action = array();
+ $match = $router->match();
+ $action = NULL;
if(!$match){
$dVueEreur[] = "Requette introuvable";
@@ -40,7 +43,11 @@ Class FrontControler{
$action=$match['params']['action'] ?? 'accueil';
//Si existe, on l’appelle
-
+ if(!$this->ifExisteAction($action)){
+ $dVueEreur[] = "Action introuvable";
+ $this->vueErreur($dVueEreur);
+ }
+
$controller = '\\Controleur\\' . $controller;
$controller = new $controller;
if (is_callable(array($controller, $action))) {
@@ -54,7 +61,11 @@ Class FrontControler{
}
private function ifExisteAction(string $action):bool {
- if( in_array($action , $listAction['admin']) || in_array($action , $listAction['user']) || in_array($action , $listAction['visiteur'])) return true;
+ if( in_array($action , $this->listAction['admin']) ||
+ in_array($action , $this->listAction['user']) ||
+ in_array($action , $this->listAction['visitor']) ) {
+ return true;
+ }
return false;
}
diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php
index 0a5c928..9b95b4c 100644
--- a/src/Controleur/VisitorControler.php
+++ b/src/Controleur/VisitorControler.php
@@ -4,30 +4,20 @@ namespace Controleur;
Class VisitorControler{
public function __construct(){
- global $vues;
- require_once $vues['accueil'];
- }
-
-
-
-
- private function ifExisteAction(string $action):bool {
- if( in_array($action , $listAction['visiteur'])) return true;
-
- return false;
+ $action = explode('/',$_SERVER['PHP_SELF']);
+ var_dump( $action[2]);
}
- private function verifDroit(string $action):bool {
- if( in_array($action , $listAction['admin']) && $role == 'admin') return true;
- elseif( in_array($action , $listAction['user']) && ($role == 'admin' || $role == 'user') ) return true;
- elseif(in_array($action , $listAction['visitor']) && ($role == 'admin'|| $role == 'user'|| $role == 'visitor')) return true;
- return false;
+ public function accueil(){
+ global $vues;
+ require_once $vues['accueil'];
}
- private function vueErreur(array $dVueErreur){
+ public function quote(array $arg){
global $vues;
- echo "{$dVueErreur[0]}";
- require_once $vues['erreur'];
+ foreach( $arg as $i){
+ echo "{$i}";
+ }
+ require_once $vues['quote'];
}
-
}
diff --git a/vue/HeaderView.php b/vue/HeaderView.php
deleted file mode 100644
index 8bd414e..0000000
--- a/vue/HeaderView.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-