diff --git a/Controllers/DefaultController.php b/Controllers/DefaultController.php
index b633c21..0590473 100644
--- a/Controllers/DefaultController.php
+++ b/Controllers/DefaultController.php
@@ -5,6 +5,26 @@ final class DefaultController
public function defaultAction(Array $A_urlParams = null, Array $A_postParams = null)
{
- View::show("home/view");
+ $array_recipes = array(
+ array(
+ "LINK" => "/recipe/view/1",
+ "NAME" => "Pâte à crêpe",
+ "IMG" => "/static/img/recipes/1.jpg",
+ "NOTE" => "4.5"
+ ),
+ array(
+ "LINK" => "/recipe/view/1",
+ "NAME" => "Pâte à crêpe",
+ "IMG" => "/static/img/recipes/1.jpg",
+ "NOTE" => "4.5"
+ ),
+ array(
+ "LINK" => "/recipe/view/1",
+ "NAME" => "Pâte à crêpe",
+ "IMG" => "/static/img/recipes/1.jpg",
+ "NOTE" => "4.5"
+ ),
+ );
+ View::show("home/view", $array_recipes);
}
}
diff --git a/Models/RecipeModel.php b/Models/RecipeModel.php
index deb61f1..a6bd09d 100644
--- a/Models/RecipeModel.php
+++ b/Models/RecipeModel.php
@@ -9,7 +9,7 @@ final class RecipeModel
$stmt = $O_model->prepare("SELECT * FROM RECIPE WHERE ID=:id");
$stmt->bindParam("id", $I_id);
$stmt->execute();
-
+
$row = $stmt->fetch();
if ($row === false) return null;
return $row;
@@ -19,15 +19,15 @@ final class RecipeModel
{
$A_recipe = self::getRecipeByID($I_id);
if ($A_recipe === null)return null;
-
- $A_recipe["IMAGE_URL"] = "/static/img/recettes/".$A_recipe["ID"].".jpg";
+
+ $A_recipe["IMAGE_URL"] = "/static/img/recipes/".$A_recipe["ID"].".jpg";
$O_ingredientModel = new IngredientModel();
$A_recipe["INGREDIENTS"] = $O_ingredientModel->searchByRecipe($A_recipe["ID"]);
$O_userModel = new UserModel();
$A_recipe["AUTHOR_USERNAME"] = $O_userModel->getUsernameByID($A_recipe["AUTHOR_ID"]);
-
+
$O_userModel = new DifficultyModel();
$A_recipe["DIFFICULTY_NAME"] = $O_userModel->getByID($A_recipe["DIFFICULTY_ID"]);
diff --git a/Views/common/recipe.php b/Views/common/recipe.php
index a78dc2e..1cabff5 100644
--- a/Views/common/recipe.php
+++ b/Views/common/recipe.php
@@ -1,7 +1,7 @@
-">
-
" alt="= $A_view["nom"]?>">
+">
+
" alt="= $A_view["NAME"]?>">
- = $A_view["nom"]?>
- = $A_view["note"]?>
+ = $A_view["NAME"]?>
+ = $A_view["NOTE"]?>
diff --git a/Views/home/view.php b/Views/home/view.php
index 059d0f3..2634ea2 100644
--- a/Views/home/view.php
+++ b/Views/home/view.php
@@ -1,34 +1,14 @@
- "Quaso",
- "img" => "4.jpg",
- "note" => "4.5"
- ),
- array(
- "nom" => "Quaso",
- "img" => "4.jpg",
- "note" => "4.5"
- ),
- array(
- "nom" => "Quaso",
- "img" => "4.jpg",
- "note" => "4.5"
- ),
-);
-?>
-
-
+
diff --git a/static/img/recettes/1.jpg b/static/img/recipes/1.jpg
similarity index 100%
rename from static/img/recettes/1.jpg
rename to static/img/recipes/1.jpg
diff --git a/static/img/recettes/2.jpg b/static/img/recipes/2.jpg
similarity index 100%
rename from static/img/recettes/2.jpg
rename to static/img/recipes/2.jpg