Commit 183568ec authored by Nathan's avatar Nathan
Browse files

Auto stash before merge of "master" and "origin/master"

parent bdaa72c2
......@@ -25,6 +25,10 @@ $app->get('/api/games/',function() {
IndexController::partie2();
})->name('partie2');
$app->get('/api/games/:id/comments',function() {
IndexController::partie5();
})->name('partie5');
......
......@@ -62,5 +62,22 @@ class IndexController
$cq2->render();*/
}
public static function partie5($id){
$comment = Commentary::select('id', 'titre', 'contenu', 'dateCreation', 'userID')->where('jeuConcerne', '=', $id)->get();
$json = '{ "comments" : [';
foreach ($comment as $c){
if($c === array_key_last($$comment)){
$json = $json . ']}';
}else{
$json = $json . json_encode($c) . ',';
}
}
$vue = new VuePartie2($json);
$vue->render();
}
}
\ No newline at end of file
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