diff options
Merge pull request #1 from Syndamia/dev v0.1
Implemented main functionality
1 files changed, 34 insertions, 0 deletions
| -rw-r--r-- | src/index.php | 34 |
diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..676cd56 --- /dev/null +++ b/src/index.php @@ -0,0 +1,34 @@ +<?php require "document-top.php"; ?> + +<?php +include_once("controllers/LandingController.php"); +include_once("controllers/CreateOfferController.php"); +include_once("controllers/DashboardLoginController.php"); + +/* The landing page practically acts as our page router. + * All request get redirected to here (look at the devrix-job-board.conf) + * Thanks https://www.taniarascia.com/the-simplest-php-router/ + */ + +$request = $_SERVER['REQUEST_URI']; + +switch ($request) { + case "": + case "/": + LandingController::invoke(); + break; + case "/CreateOffer": + case "/CreateOffer/": + CreateOfferController::invoke(); + break; + case "/Dashboard": + case "/Dashboard/": + DashboardLoginController::invoke(); + break; + default: + http_response_code(404); + break; +} +?> + +<?php require "document-bot.php"; ?> |
