-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
64 lines (32 loc) · 1.76 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
<?php
use App\Controller\Router;
require 'vendor/autoload.php';
$router = new router();
$router->setBasePath('/Projet5');
//Front management
$router->map('GET', '/', 'FrontController#home');
$router->map('GET', '/posts', 'FrontController#listPosts');
$router->map('GET', '/post/[i:id]', 'FrontController#post');
$router->map('GET', '/register', 'FrontController#registerView');
$router->map('POST', '/register', 'FrontController#register');
$router->map('POST', '/comment/add', 'FrontController#addComment');
$router->map('POST', '/', 'FrontController#contactForm');
$router->map('GET', '/CV', 'FrontController#cvNico');
$router->map('GET', '/CGV', 'FrontController#getCGV');
//Admin Management
$router->map('GET', '/admin', 'AdminController#listPosts');
$router->map('GET', '/admin/post/[i:id]', 'AdminController#updatePostView');
$router->map('POST', '/admin/post/[i:id]', 'AdminController#UpdatePost');
$router->map('POST', '/admin/post/delete/[i:id]', 'AdminController#deletePost');
$router->map('GET', '/admin/add', 'AdminController#addPostView');
$router->map('POST', '/admin/addpost', 'AdminController#addPost');
$router->map('GET', '/admin/comments/[i:id]', 'AdminController#listComments');
$router->map('POST', '/admin/comment/delete/[i:id]', 'AdminController#deleteComment');
$router->map('POST', '/admin/comment/validate/[i:id]', 'AdminController#validateComment');
//login Management
$router->map('GET', '/login', 'FrontController#login');
$router->map('POST', '/connect', 'FrontController#connect');
$router->map('GET', '/logout', 'FrontController#deconnect');
$match = $router->match();
$router->routerRequest($match['target'], $match['params']);
?>