Commit bdaa72c2 authored by Nathan's avatar Nathan
Browse files

Merge remote-tracking branch 'origin/master'

parents 268f78d9 6621c7cd
......@@ -27,6 +27,7 @@ $app->get('/api/games/',function() {
$app->run();
//echo "<a href='Question1.php'>question 1 -- afficher (name, deck) les personnages du jeu 12342</a><br>";
......
......@@ -17,11 +17,24 @@ class IndexController
}
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::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT);
$json = '{ "games" : [ ';
foreach($game as $key => $value) {
<<<<<<< HEAD
$json = $json . json_encode($value) . ',';
/*$json = $json . '{
"id": ' . $value->id . ',
......@@ -36,12 +49,18 @@ class IndexController
"name":' . $value->name . ',
"deck":' . $value->deck . ',
}
';*/
';
}
}
$json = $json . ']}';
=======
$value->description = "...";
}
$json = json_encode($game);
>>>>>>> e2c791070c5330916f63fb55c2b639a71a327bcb
$cq2 = new VuePartie2($json);
$cq2->render();
$cq2->render();*/
}
}
\ No newline at end of file
......@@ -12,21 +12,21 @@ class VuePartie1
$json = json_encode($game);
$this->content = <<< END
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" content="application/json">
<link rel="stylesheet" href="css/main.css">
<title>photobox</title>
</head>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" content="application/json">
<link rel="stylesheet" href="css/main.css">
<title>photobox</title>
</head>
<body>
<body>
$json
$json
</body>
</body>
END;
......
......@@ -21,12 +21,11 @@ class VuePartie2
<link rel="stylesheet" href="css/main.css">
<title>photobox</title>
<title>AppliBD</title>
</head>
<body>
<h1>Titre</h1>
<p>$json</p>
$json
</body>
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