A simple template for quick and dirty PHP apps.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.php 530B

123456789101112131415161718192021
  1. <?php
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. class Routes {
  6. private static $ROUTES = [
  7. "home" => "home.php"
  8. ];
  9. public static function getRoute($page = "home") {
  10. if (array_key_exists($page, Routes::$ROUTES)) {
  11. return Routes::$ROUTES[$page];
  12. } else {
  13. return Routes::$ROUTES["home"];
  14. }
  15. }
  16. }