您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

67 行
2.3KB

  1. <?php
  2. namespace Config;
  3. // Create a new instance of our RouteCollection class.
  4. $routes = Services::routes();
  5. // Load the system's routing file first, so that the app and ENVIRONMENT
  6. // can override as needed.
  7. if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
  8. require SYSTEMPATH . 'Config/Routes.php';
  9. }
  10. /*
  11. * --------------------------------------------------------------------
  12. * Router Setup
  13. * --------------------------------------------------------------------
  14. */
  15. $routes->setDefaultNamespace('App\Controllers');
  16. $routes->setDefaultController('Home');
  17. $routes->setDefaultMethod('index');
  18. $routes->setTranslateURIDashes(false);
  19. $routes->set404Override();
  20. // The Auto Routing (Legacy) is very dangerous. It is easy to create vulnerable apps
  21. // where controller filters or CSRF protection are bypassed.
  22. // If you don't want to define all routes, please use the Auto Routing (Improved).
  23. // Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
  24. //$routes->setAutoRoute(false);
  25. /*
  26. * --------------------------------------------------------------------
  27. * Route Definitions
  28. * --------------------------------------------------------------------
  29. */
  30. // We get a performance increase by specifying the default
  31. // route since we don't have to scan directories.
  32. $routes->get('/', 'Prestador::index');
  33. $routes->get('horas/', 'Prestador::horas');
  34. $routes->match(['get', 'post'], 'registro/', 'Prestador::formulario');
  35. $routes->get('success', 'Prestador::success');
  36. // utilizar m�todo attemptRegister personalizdo (no requiere de username)
  37. $routes->post('register/', 'Auth::attemptRegister');
  38. $routes->group('admin', static function ($routes) {
  39. $routes->get('/', 'Admin::home', ['as' => 'admin_home']);
  40. });
  41. /*
  42. * --------------------------------------------------------------------
  43. * Additional Routing
  44. * --------------------------------------------------------------------
  45. *
  46. * There will often be times that you need additional routing and you
  47. * need it to be able to override any defaults in this file. Environment
  48. * based routes is one such time. require() additional route files here
  49. * to make that happen.
  50. *
  51. * You will have access to the $routes object within that file without
  52. * needing to reload it.
  53. */
  54. if (is_file(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
  55. require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
  56. }