}); // Radan esittelysivu $routes->get('/course/:courseid', 'check_logged_in', function ($courseid) { CourseController::show($courseid); }); // Radan muokkauslomakkeen esittäminen (vain admin) $routes->get('/course/:courseid/edit', 'check_admin_logged_in', function ($courseid) { CourseController::edit($courseid); }); // Radan muokkaaminen (vain admin) $routes->post('/course/:courseid/edit', 'check_admin_logged_in', function ($courseid) { CourseController::update($courseid); }); // Radan poisto (vain admin) $routes->post('/course/:courseid/destroy', 'check_admin_logged_in', function ($courseid) { CourseController::destroy($courseid); }); // Pelit // Pelien listaussivu $routes->get('/game', 'check_logged_in', function () { GameController::index(); }); // Pelin lisääminen tietokantaan $routes->post('/game', 'check_logged_in', function () { GameController::store(); }); // Pelin lisäyssivu $routes->get('/game/new', 'check_logged_in', function () { GameController::create(); }); // Pelin esittelysivu
CourseController::create(); }); $routes->get('/course/:id', function ($id) { CourseController::show($id); }); $routes->get('/course/:id/add', 'check_logged_in', function ($id) { RoundController::create($id); }); $routes->get('/course/:id/edit', 'check_logged_in', function ($id) { CourseController::edit($id); }); $routes->post('/course/:id/edit', 'check_logged_in', function ($id) { CourseController::update($id); }); $routes->post('/course/:id/destroy', 'check_logged_in', function ($id) { CourseController::destroy($id); }); ## Round $routes->get('/round', function () { RoundController::list_all(); }); $routes->post('/round', function () { RoundController::store(); }); $routes->get('/round/new', function () { RoundController::create(); }); $routes->post('/round/new', function () { RoundController::create(); }); $routes->get('/round/:id', function ($id) {