modified: SRC/app/Http/Controllers/ReferentController.php
modified: SRC/app/Http/routes.php modified: SRC/public/js/ListeOeuvre.js modified: SRC/resources/views/referent.blade.php
This commit is contained in:
@ -168,33 +168,15 @@ class ReferentController extends Controller {
|
||||
$ListeOeuvre->jeux()->sync($table);
|
||||
}
|
||||
|
||||
public function getAssoGames($id) {
|
||||
|
||||
$ListeOeuvre = ListeOeuvre::find($id);
|
||||
return Response::json($ListeOeuvre->jeux()->get()->toArray());
|
||||
}
|
||||
|
||||
public function getImage($filename) {
|
||||
|
||||
// Append the filename to the path where our images are located
|
||||
$path = Config::get('view.images') . $filename;
|
||||
print($path);
|
||||
|
||||
// Initialize an instance of Symfony's File class.
|
||||
// This is a dependency of Laravel so it is readily available.
|
||||
$file = new Symfony\Component\HttpFoundation\File\File($path);
|
||||
|
||||
// Make a new response out of the contents of the file
|
||||
// Set the response status code to 200 OK
|
||||
$response = Response::make(
|
||||
File::get($path),
|
||||
200
|
||||
);
|
||||
|
||||
// Modify our output's header.
|
||||
// Set the content type to the mime of the file.
|
||||
// In the case of a .jpeg this would be image/jpeg
|
||||
$response->header(
|
||||
'Content-type',
|
||||
$file->getMimeType()
|
||||
);
|
||||
|
||||
// We return our image here.
|
||||
return $response;
|
||||
// TODO
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user