diff --git a/tp1/src/index.php b/tp1/src/index.php index efb43c45d7e44efc829fb3bf98e744f7fe8bcecf..5beaad6d85db9d6a0ffec040ec3cf545bdeaeb23 100644 --- a/tp1/src/index.php +++ b/tp1/src/index.php @@ -1,4 +1,6 @@ addConnection([ $db->setAsGlobal(); $db->bootEloquent(); -// demerage d'un session session_start(); -// intance de slim qui a pour but de créer le rootage des urls $app = new Slim(); $app->get('/', function () { @@ -41,15 +41,19 @@ $app->get('/', function () { $v->renderHome(); })->name('accueil'); $app->get('/ex1/requete1', function () { - + $c = new ControleurRequete(); + $c->selectMario(); })->name('ex1 requete 1'); $app->get('/ex1/requete2', function () { + $c = new ControleurRequete(); })->name('ex1 requete 2'); $app->get('/ex1/requete3', function () { + $c = new ControleurRequete(); })->name('ex1 requete 3'); $app->get('/ex1/requete4', function () { + $c = new ControleurRequete(); })->name('ex1 requete 4'); diff --git a/tp1/src/vue/RequeteVue.php b/tp1/src/vue/RequeteVue.php new file mode 100644 index 0000000000000000000000000000000000000000..a8e70541baac2b5b3b2180be6aa7b990cd2b5718 --- /dev/null +++ b/tp1/src/vue/RequeteVue.php @@ -0,0 +1,67 @@ +tab = $t; + $this->app = Slim::getInstance(); + } + + public function render($type) + { + switch ($type) { + case 1: + return $this->selectMario(); + break; + default: + return $this->notFound(); + break; + } + } + + private function notFound() + { + $res .= << + + + + + + +

data not found

+ + +RES; + } + + private function selectMario() + { + $res .= << + + + + + + + +RES; + foreach ($this->tab as $key => $value) { + $res .= << + +RES; + return $res; + } +}