-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
61 lines (51 loc) · 1.56 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
<?php
require __DIR__."/vendor/autoload.php";
use CoffeeCode\Router\Router;
$router = new Router(URL);
$router->namespace("Source\Controller");
/*
* WEB
* home
* sobre
* como funciona
*/
$router->group(null);
$router->get("/", "Web:home");
$router->get("/sobre", "Web:sobre");
$router->get("/comofunciona", "Web:comoFunciona");
$router->get("/recuperar", "Web:recuperar");
$router->post("/recuperar/{solicitacao}", "Web:recuperar");
$router->get("/recuperar/validado/{email}/{token}", "Web:recuperarConfirmado");
$router->post("/recuperar/validado/{email}/{token}/{alter}", "Web:recuperarConfirmado");
/*
* CADASTRO
*/
$router->group("cadastro");
$router->post("/", "Web:cadastro");
/*
* ENTRAR
* autenticacao
* cadastroSucedido
*/
$router->group("entrar");
$router->get("/", "Web:entrar");
$router->post("/{autenticacao}", "Web:entrar");
$router->get("/{cadastro}", "Web:entrar");
/*
* DASHBOARD
* configurações
*/
$router->group("dashboard");
$router->get("/", "Web:dashboard");
$router->get("/{secao}", "Web:dashboard");
$router->post("/{secao}", "Web:dashboard");
$router->get("/{secao}/{id}", "Web:dashboard");
/*
*ERROR
*/
$router->group("ooops");
$router->get("/{errcode}", "Web:error"); // Recebe o código do erro em /erro
$router->dispatch();
if($router->error()){
$router->redirect("/ooops/{$router->error()}");
}