-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
45 lines (38 loc) · 1.14 KB
/
index.php
File metadata and controls
45 lines (38 loc) · 1.14 KB
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
<?php
require "vendor/autoload.php";
use phpSPA\App;
use phpSPA\Component;
require "pages/layouts/Layout.php";
require "pages/Home.php";
require "pages/auth/Login.php";
require "pages/auth/Logout.php";
require "pages/auth/Register.php";
require "pages/user/Profile.php";
require "controllers/auth/AuthController.php";
$app = new App("Layout");
$app->defaultTargetID("app");
$app->attach(new Component("Home")->title("Home")->method("GET")->route("/"));
$app->attach(
new Component("Login")->title("Login")->method("GET")->route("/login"),
);
$app->attach(
new Component("Logout")->title("Logout")->method("GET")->route("/logout"),
);
$app->attach(
new Component("Register")
->title("Login")
->method("GET")
->route("/register"),
);
$app->attach(
new Component("UserProfile")
->title("Profile")
->method("GET")
->route("/profile"),
);
$app->attach(new Component("LoginHandler")->method("POST")->route("/login"));
$app->attach(
new Component("RegisterHandler")->method("POST")->route("/register"),
);
$app->attach(new Component("LogoutHandler")->method("POST")->route("/logout"));
$app->run();