-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
78 lines (52 loc) · 1.77 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
// Turn on error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Require the autoload file
require_once('vendor/autoload.php');
require_once('model/data-layer.php');
//testing my DataLayer class
/*$dataLayer = new DataLayer();
$dataLayer->saveApplicant();*/
//Start a session
session_start();
//test code for applicant class
/*$applicant1 = new Applicant();
$applicant1->setFname("Rodney");
echo $applicant1->getFname();
var_dump($applicant1);*/
// Create an instance of the Base class (instantiate F3 base class)
$f3 = Base::instance();
// Java equivalent -> Base f3 = new Base();
//Instantiate a Controller object
$con = new Controller($f3);
//Instantiate a DataLayer object
$dataLayer = new DataLayer();
// Define a default route ("home page" for 328/application)
//this is what the user sees when they go to the main directory
$f3->route('GET /', function () {
$GLOBALS['con']->home();
});
// Define route ("personal info page" for 328/application/personal)
$f3->route('GET|POST /personal', function ($f3) {
$GLOBALS['con']->personal();
});
// Define route ("experience/biography page" for 328/application/experience)
$f3->route('GET|POST /experience', function ($f3) {
$GLOBALS['con']->experience();
});
// Define route ("job openings page" for 328/application/job-openings)
$f3->route('GET|POST /openings', function ($f3) {
$GLOBALS['con']->openings();
});
// Define route ("summary" for 328/application/summary)
$f3->route('GET /summary', function () {
$GLOBALS['con']->summary();
});
// Define route ("admin" for 328/application/admin)
$f3->route('GET /admin', function () {
$GLOBALS['con']->admin();
});
//Run Fat-free
$f3->run();
// Java -> f3.run();