説明なし

router.php 561B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. $router = $di->getRouter();
  3. // Define your routes here
  4. $router->handle($_SERVER['REQUEST_URI']);
  5. $router->add('/',[
  6. 'controller' => 'index',
  7. 'action' => 'index',
  8. ]);
  9. $router->add('/:controller/:action/:params',[
  10. 'controller' => 1,
  11. 'action' => 2,
  12. 'params' => 3
  13. ]);
  14. $router->add('/:controller',[
  15. 'controller' => 1,
  16. 'action' => 'index'
  17. ]);
  18. $router->add('/gogs/:params',[
  19. 'controller'=>'gogs',
  20. 'action'=>'index',
  21. 'params'=>1
  22. ]);
  23. $router->notFound([
  24. 'controller' => 'index',
  25. 'action' => 'show404',
  26. ]);