Example #1
0
    $categorie = Categorie::AddCategorie($_POST["nomCategorie"]);
});
$app->put('/ModifCategorie', function () {
    //ajoute une categorie
    $categorie = Categorie::ModifCategorie($_POST["nomCategorie"], $_POST["id"]);
});
$app->delete('/DelCategorie', function () {
    //ajoute une categorie
    $categorie = Categorie::DelCategorie($_POST["id"]);
});
/*--------------------------------------------------
						RECETTE
--------------------------------------------------*/
$app->get('/getRecette', function () {
    //renvoi les infos de la recette
    Recette::getRecette();
});
$app->get('/getRecetteByID/:recetteID', function ($recetteID) {
    //renvoi les infos de la recette
    Recette::getRecetteByID($recetteID);
});
$app->get('/getRecetteByName/:nomRecette', function ($nomRecette) {
    //renvoi les infos de la recette
    $recette = Recette::getRecetteByName($nomRecette);
});
$app->get('/getRecetteByComplexite/:complexite/:userId', function ($complexite, $userId) {
    //renvoi les recettes avec une complexité < ou =
    $recette = Recette::getRecetteByComplexite($complexite, $userId);
});
$app->get('/getRecetteByNote/:note/:userId', function ($note, $userId) {
    //renvoi les recettes avec une note > ou =