Updated database tables to include entities

This commit is contained in:
Joshua Perry 2023-01-23 14:37:23 +00:00
parent d8fa24e186
commit 018c046d85
2 changed files with 9 additions and 5 deletions

View File

@ -22,6 +22,10 @@ class EntryPoint {
list($controllerName, $functionName) = \explode('/', $route); list($controllerName, $functionName) = \explode('/', $route);
if ($functionName == '') {
$functionName = 'home';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$functionName = $functionName . 'Submit'; $functionName = $functionName . 'Submit';
} }

View File

@ -2,19 +2,19 @@
namespace jobs; namespace jobs;
class Routes implements \CSY2028\Routes { class Routes implements \CSY2028\Routes {
public function getController($name) { public function getController($name) {
//TODO: Add Database Tables $catsTable = new \CSY2028\DatabaseTable('category', 'id', '\jobs\Entity\Category');
//Remember entities $jobsTable = new \CSY2028\DatabaseTable('jobs', 'id', '\jobs\Entity\Job', [$catsTable]);
$jobsTable = new \CSY2028\DatabaseTable('jobs', 'id'); $appsTable = new \CSY2028\DatabaseTable('applicants', 'id', '\jobs\Entity\Applicant', [$jobsTable]);
$controllers = []; $controllers = [];
//TODO: Add Controllers //TODO: Add Controllers
$controllers['home'] = new \jobs\controllers\Home($jobsTable); $controllers['jobs'] = new \jobs\controllers\Jobs($jobsTable);
return $controllers[$name]; return $controllers[$name];
} }
public function getDefaultRoute() { public function getDefaultRoute() {
return 'home/home'; return 'jobs/home';
} }
public function checkLogin($route) { public function checkLogin($route) {