Skip to content
Snippets Groups Projects
Commit bdaa72c2 authored by Nathan's avatar Nathan
Browse files

Merge remote-tracking branch 'origin/master'

parents 268f78d9 6621c7cd
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ $app->get('/api/games/',function() { ...@@ -27,6 +27,7 @@ $app->get('/api/games/',function() {
$app->run(); $app->run();
//echo "<a href='Question1.php'>question 1 -- afficher (name, deck) les personnages du jeu 12342</a><br>"; //echo "<a href='Question1.php'>question 1 -- afficher (name, deck) les personnages du jeu 12342</a><br>";
......
...@@ -17,11 +17,24 @@ class IndexController ...@@ -17,11 +17,24 @@ class IndexController
} }
public static function partie2() { public static function partie2() {
$game = Game::select('id','name','alias','deck')->where('id','<=','200')->get();
// $game = Game::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT);
$json = '{ "games" : [ ';
foreach($game as $key => $value) {
$json = $json . '"game" :{';
$json = $json . json_encode($value) . ',},"links" :{"self": {"href":"/api/games/'.$value->id.'"}}';
}
$json = $json . ']}';
$cq2 = new CQuestion2($json);
$cq2->render();
/*
$game = Game::select('id','name','alias','deck')->where('id','<=','200')->get(); $game = Game::select('id','name','alias','deck')->where('id','<=','200')->get();
// $game = Game::where('id','=',1)->get(); // $game = Game::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT); // $json = json_encode($game,JSON_FORCE_OBJECT);
$json = '{ "games" : [ ';
foreach($game as $key => $value) { foreach($game as $key => $value) {
<<<<<<< HEAD
$json = $json . json_encode($value) . ','; $json = $json . json_encode($value) . ',';
/*$json = $json . '{ /*$json = $json . '{
"id": ' . $value->id . ', "id": ' . $value->id . ',
...@@ -36,12 +49,18 @@ class IndexController ...@@ -36,12 +49,18 @@ class IndexController
"name":' . $value->name . ', "name":' . $value->name . ',
"deck":' . $value->deck . ', "deck":' . $value->deck . ',
} }
';*/ ';
} }
} }
$json = $json . ']}'; $json = $json . ']}';
=======
$value->description = "...";
}
$json = json_encode($game);
>>>>>>> e2c791070c5330916f63fb55c2b639a71a327bcb
$cq2 = new VuePartie2($json); $cq2 = new VuePartie2($json);
$cq2->render(); $cq2->render();*/
} }
} }
\ No newline at end of file
...@@ -12,21 +12,21 @@ class VuePartie1 ...@@ -12,21 +12,21 @@ class VuePartie1
$json = json_encode($game); $json = json_encode($game);
$this->content = <<< END $this->content = <<< END
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta charset="UTF-8" content="application/json"> <meta charset="UTF-8" content="application/json">
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
<title>photobox</title> <title>photobox</title>
</head> </head>
<body> <body>
$json $json
</body> </body>
END; END;
......
...@@ -21,12 +21,11 @@ class VuePartie2 ...@@ -21,12 +21,11 @@ class VuePartie2
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
<title>photobox</title> <title>AppliBD</title>
</head> </head>
<body> <body>
<h1>Titre</h1> $json
<p>$json</p>
</body> </body>
END; END;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment