Commit e2c79107 authored by KELBERT Paul's avatar KELBERT Paul
Browse files

partie 2

parent 5c290c5f
...@@ -20,26 +20,10 @@ class IndexController ...@@ -20,26 +20,10 @@ class IndexController
$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) {
$json = $json . json_encode($value) . ','; $value->description = "...";
/*$json = $json . '{ }
"id": ' . $value->id . ', $json = json_encode($game);
"name":' . $value->name . ',
"deck":' . $value->deck . ',
},
';*/
if ($value->id == 200) {
$json = $json . json_encode($value);/*
$json = $json . '{
"id": ' . $value->id . ',
"name":' . $value->name . ',
"deck":' . $value->deck . ',
}
';*/
}
}
$json = $json . ']}';
$cq2 = new VuePartie2($json); $cq2 = new VuePartie2($json);
$cq2->render(); $cq2->render();
} }
......
...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment