Updated database tables to include entities
This commit is contained in:
parent
d8fa24e186
commit
018c046d85
|
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue