Exemplo n.º 1
0
            $controller->listUsers($_POST);
            break;
    }
} else {
    switch ($_GET['sec']) {
        case "Activate":
            $controller->__changeStatus($_GET['userId'], 1);
            $controller->listUsers($_GET);
            break;
        case "Inactivate":
            $controller->__changeStatus($_GET['userId'], 0);
            $controller->listUsers($_GET);
            break;
        case "delete":
            $controller->__deleteUser($_GET['userId']);
            $controller->listUsers($_GET);
            break;
        case "edit":
            $controller->editUser($_GET['userId']);
            break;
        case "new":
            $controller->newUser();
            break;
        case "my-profile":
            $controller->showMyProfile();
            break;
        default:
            $controller->listUsers($_GET);
            break;
    }
}
Exemplo n.º 2
0
    UserController::login();
});
$routes->get('/logout', function () {
    UserController::logout();
});
$routes->get('/users', function () {
    UserController::showUsers();
});
$routes->get('/user/:id', function ($id) {
    UserController::showUser($id);
});
$routes->post('/users/:id/destroy', function ($id) {
    UserController::destroyUser($id);
});
$routes->get('/users/:id/edit', function ($id) {
    UserController::editUser($id);
});
$routes->post('/users/:id/edit?', function ($id) {
    UserController::updateUser($id);
});
$routes->get('/hiekkalaatikko', function () {
    HelloWorldController::sandbox();
});
$routes->get('/favorites', function () {
    UserController::showFavorites();
});
$routes->get('/drink', function () {
    DrinkController::index();
});
$routes->get('/drink/:id', function ($id) {
    DrinkController::show($id);