-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.php
executable file
·27 lines (22 loc) · 1.2 KB
/
routes.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
<?php
namespace app;
require __DIR__ . '/vendor/autoload.php'; #Cargar todas las dependencias
use Phroute\Phroute\RouteCollector;
$collector = new RouteCollector();
$collector->get("/", ['app\controllers\User_Controller','principal']);
$collector->get("/login", ['app\controllers\User_Controller','loginView']);
$collector->get("/products", ['app\controllers\Product_Controller','index']);
$collector->post("/products/stars_value", ['app\controllers\ProductClasification_Controller','putClasification']);
$collector->get("/carts", ['app\controllers\ShoppingCart_Controller','index']);
$collector->post("/carts/add",['app\controllers\ShoppingCart_Controller','addProductToCartByUser']);
$collector->post("/carts/update",['app\controllers\ShoppingCart_Controller','updateToCart']);
$collector->post("/carts/delete",['app\controllers\ShoppingCart_Controller','delete']);
$collector->post("/carts/pay",['app\controllers\UserPay_Controller','pay']);
$collector->get("/logout", ['app\controllers\User_Controller','logoff']);
$collector->get("/usuarios", function(){
echo "Obtener los usuarios";
echo '</br';
echo $_SESSION['name'];
});
$collector->post("/login", ['app\controllers\User_Controller','login']);
return $collector;