Esempio n. 1
0
    IngredientController::showIngredient($aines_id);
});
$routes->get('/ingredients', 'check_logged_in', function () {
    IngredientController::listIngredients();
});
$routes->post('/ingredients', 'check_logged_in', function () {
    IngredientController::store();
});
$routes->post('/ingredients/:aines_id/destroy_ingredient', function ($aines_id) {
    IngredientController::destroy($aines_id);
});
$routes->get('/ingredients/:aines_id/edit_ingredient', 'check_logged_in', function ($aines_id) {
    IngredientController::editIngredient($aines_id);
});
$routes->post('/ingredients/:aines_id/edit_ingredient', function ($aines_id) {
    IngredientController::update($aines_id);
});
$routes->get('/drinks/:drinkki_id/edit', 'check_logged_in', function ($drinkki_id) {
    DrinksController::edit($drinkki_id);
});
$routes->post('/drinks/:drinkki_id/edit', function ($drinkki_id) {
    DrinksController::update($drinkki_id);
});
$routes->post('/drinks/:drinkki_id/destroy', function ($drinkki_id) {
    DrinksController::destroy($drinkki_id);
});
$routes->get('/drinks_list', function () {
    HelloWorldController::drinks_list();
});
$routes->get('/drinks_show', function () {
    HelloWorldController::drinks_show();
Esempio n. 2
0
});
$routes->post('/tuotteet/:category/lisaa', 'check_logged_in', 'check_if_admin', function () {
    ProductController::add();
});
$routes->get('/tuotteet/:category/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($category, $id) {
    ProductController::edit_form($id);
});
$routes->post('/tuotteet/:category/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($category, $id) {
    ProductController::edit($id);
});
$routes->post('/tuotteet/:id/poista', 'check_logged_in', 'check_if_admin', function ($id) {
    ProductController::delete($id);
});
$routes->get('/ainesosat', 'check_logged_in', 'check_if_admin', function () {
    IngredientController::get_ingredients();
});
$routes->get('/ainesosat/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($id) {
    IngredientController::edit_form($id);
});
$routes->post('/ainesosat/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($id) {
    IngredientController::edit($id);
});
$routes->get('/ainesosat/lisaa', 'check_logged_in', 'check_if_admin', function () {
    IngredientController::add_form();
});
$routes->post('/ainesosat/lisaa', 'check_logged_in', 'check_if_admin', function () {
    IngredientController::add();
});
$routes->post('/ainesosat/:id/poista', 'check_logged_in', 'check_if_admin', function ($id) {
    IngredientController::delete($id);
});