Skip to content
Snippets Groups Projects
Commit 742d2ac6 authored by SASSU Thomas's avatar SASSU Thomas
Browse files

Partie 7

parent 5ea3ce00
No related branches found
No related tags found
No related merge requests found
......@@ -62,4 +62,16 @@ class ControleurGame
$v = new VueGame(json_encode($results));
$v->render('getPlatforms');
}
public function getGameCharacters($id){
$game = Game::where('id', '=', $id)->first();
$characters = $game->characters()->get();
$route = explode('bdappli_laurent_vonderscher_sassu_percin/GamePedia',Slim::getInstance()->urlFor('getCharacters'));
foreach ($characters as $character) {
$url = $route[1]."{$character['id']}";
$results['characters'][] = ["character" => $character, "links" => ["self" => ["href" => $url]]];
}
$v = new VueGame(json_encode($results));
$v->render('getPlatforms');
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment