public function init() { $l = new LayoutView(); $lv = new LoginView(); $lm = new LoginModel(); $lc = new LogController($lv, $lm, $l); // short text variable too difficult to read? post me and i rename them to the original name // Lazy to write out a work in a hurry in Master Class $dg = new DiceGame(); $d = new Dice(); $c = new Cash($dg); $dv = new DiceView($d, $dg, $c); $pc = new PlayerController($dv, $d, $dg, $c); if ($lc->isLoggedin()) { $sv = new StartView(); $l->render($sv); if ($sv->GetGame()) { $pc->CheckRoll(); $l->render($dv); } } else { $lc->initLogin(); $lc->renderLoginLayout(); } }
$routes->get('/game/old/:year', 'check_logged_in', function ($year) { GameController::display_score_card_pictures_by_year($year); }); // Pelaaja // Pelaajien listaussivu ja esittelysivu $routes->get('/player', 'check_logged_in', function () { PlayerController::index(); }); // Pelaajien traditionaalinen listaussivu - onko tarvetta? $routes->get('/player/list', 'check_logged_in', function () { // Not implemented yet // PlayerController::list_players(); }); // Infosivu $routes->get('/info', function () { PlayerController::info(); }); // Välimuistisivujen poisto (vain admin) $routes->get('/clearcache', 'check_admin_logged_in', function () { Cache::clear(); Redirect::to('/', array('message' => 'Sivujen välimuisti poistettu.')); }); // Kuvaajat $routes->get('/graphs', 'check_logged_in', function () { GraphController::index(); }); // Käyttäjä // Kirjautumislomakkeen esittäminen $routes->get('/login', function () { UserController::login(); });
PlayerController::store(); }); $routes->get('/player/new', function () { PlayerController::create(); }); $routes->get('/player/:id', function ($id) { PlayerController::show($id); }); $routes->get('/player/:id/edit', function ($id) { PlayerController::edit($id); }); $routes->post('/player/:id/edit', function ($id) { PlayerController::update($id); }); $routes->post('/player/:id/destroy', function ($id) { PlayerController::destroy($id); }); $routes->get('/team', function () { TeamController::index(); }); $routes->post('/team', function () { TeamController::store(); }); $routes->get('/team/new', function () { TeamController::create(); }); $routes->get('/team/:id', function ($id) { TeamController::show($id); }); $routes->get('/team/:id/edit', function ($id) { TeamController::edit($id);