<?php require_once 'controller/todoController.php'; $controller = new TodoController(); $controller->handleRequest();
}); $routes->post('/:id/mark_undone', 'check_logged_in', function ($id) { TodoController::mark_undone($id); }); $routes->post('/logout', function () { UserController::logout(); }); $routes->get("/add_reminder", 'check_logged_in', function () { ClassController::addReminder(); }); $routes->get("/category", 'check_logged_in', function () { TodoController::editCategories(); }); $routes->get('/category/:categoryId/delete_category', 'check_logged_in', function ($id) { TodoController::destroyCategory($id); }); $routes->get('/:todoId/show', 'check_logged_in', function ($id) { TodoController::showTodo($id); }); $routes->get('/category/:categoryId/edit_category', 'check_logged_in', function ($categoryId) { ClassController::editCategory($categoryId); }); $routes->post('/category/:categoryId/edit_category', 'check_logged_in', function ($categoryId) { ClassController::update($categoryId); }); $routes->get('/category/add_new', 'check_logged_in', function () { ClassController::newCategory(); }); $routes->post('/category/add_new', 'check_logged_in', function () { ClassController::store(); });