defaultNamespace() * * Modifies the namespace that is added to a controller if it doesn't * already have one. By default this is the global namespace (\). * * $routes->defaultController() * * Changes the name of the class used as a controller when the route * points to a folder instead of a class. * * $routes->defaultMethod() * * Assigns the method inside the controller that is ran when the * Router is unable to determine the appropriate method to run. * * $routes->setAutoRoute() * * Determines whether the Router will attempt to match URIs to * Controllers when no specific route has been defined. If false, * only routes that have been defined here will be available. */ $routes->setDefaultNamespace('App\Controllers'); $routes->setDefaultController('GameController'); $routes->setDefaultMethod('index'); $routes->setTranslateURIDashes(false); $routes->set404Override(); $routes->setAutoRoute(true); /** * -------------------------------------------------------------------- * Route Definitions * -------------------------------------------------------------------- */ // We get a performance increase by specifying the default // route since we don't have to scan directories. $routes->get('/', 'GameController::index'); /** * -------------------------------------------------------------------- * GAME ROUTES * -------------------------------------------------------------------- */ $routes->add('createUser', 'GameController::createUser'); $routes->add('createUser/(:segment)/(:segment)', 'GameController::createUser/$1/$2'); $routes->add('endGame', 'GameController::endGame'); $routes->add('getUser', 'GameController::getUser'); $routes->add('getUser/(:segment)', 'GameController::getUser/$1'); $routes->add('play', 'GameController::play'); $routes->add('play/(:segment)', 'GameController::play/$1'); $routes->add('setup', 'SetupController::setup'); //$routes->add('testUser', 'GameController::testUser'); $routes->add('testUser/(:segment)', 'GameController::testUser/$1'); $routes->add('top10', 'GameController::top10'); /** * -------------------------------------------------------------------- * Additional Routing * -------------------------------------------------------------------- * * There will often be times that you need additional routing and you * need to it be able to override any defaults in this file. Environment * based routes is one such time. require() additional route files here * to make that happen. * * You will have access to the $routes object within that file without * needing to reload it. */ if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) { require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'; }