add CategoriesController
This commit is contained in:
parent
ca1c97b94d
commit
4c02a3ec74
41
Controllers/CategoriesController.php
Normal file
41
Controllers/CategoriesController.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
final class CategoriesController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function defaultAction(Array $A_urlParams = null, Array $A_postParams = null)
|
||||||
|
{
|
||||||
|
$A_array_recipes_Type_de_cuisson = array( //test
|
||||||
|
array(
|
||||||
|
"id" => "1",
|
||||||
|
"nom" => "Quaso",
|
||||||
|
"img" => "4.jpg",
|
||||||
|
"note" => "4.5"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"id" => "1",
|
||||||
|
"nom" => "Quaso",
|
||||||
|
"img" => "4.jpg",
|
||||||
|
"note" => "4.5"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"id" => "1",
|
||||||
|
"nom" => "Quaso",
|
||||||
|
"img" => "4.jpg",
|
||||||
|
"note" => "4.5"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$A_array_categories = array(
|
||||||
|
"Type de cuisson" => $A_array_recipes_Type_de_cuisson,
|
||||||
|
"Temps de préparation" => $A_array_recipes_Type_de_cuisson,
|
||||||
|
"Difficulté" => $A_array_recipes_Type_de_cuisson,
|
||||||
|
"Végan" => $A_array_recipes_Type_de_cuisson,
|
||||||
|
"Sans gluten" => $A_array_recipes_Type_de_cuisson,
|
||||||
|
"Sans lactose" => $A_array_recipes_Type_de_cuisson
|
||||||
|
);
|
||||||
|
|
||||||
|
View::show("category/view", $A_array_categories);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
$array_recepies_Type_de_cuisson = array( //test
|
|
||||||
array(
|
|
||||||
"id" => "1",
|
|
||||||
"nom" => "Quaso",
|
|
||||||
"img" => "4.jpg",
|
|
||||||
"note" => "4.5"
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
"id" => "1",
|
|
||||||
"nom" => "Quaso",
|
|
||||||
"img" => "4.jpg",
|
|
||||||
"note" => "4.5"
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
"id" => "1",
|
|
||||||
"nom" => "Quaso",
|
|
||||||
"img" => "4.jpg",
|
|
||||||
"note" => "4.5"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$array_categories = array(
|
|
||||||
"Type de cuisson" => $array_recepies_Type_de_cuisson,
|
|
||||||
"Temps de préparation" => $array_recepies_Type_de_cuisson,
|
|
||||||
"Difficulté" => $array_recepies_Type_de_cuisson,
|
|
||||||
"Végan" => $array_recepies_Type_de_cuisson,
|
|
||||||
"Sans gluten" => $array_recepies_Type_de_cuisson,
|
|
||||||
"Sans lactose" => $array_recepies_Type_de_cuisson
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
foreach ($array_categories as $categoryName => $recipes) {
|
|
||||||
echo '<li><section>
|
|
||||||
<h1><?$key?></h1>
|
|
||||||
<ul>';
|
|
||||||
foreach ($recipes as $recipe) {
|
|
||||||
echo '<li>';
|
|
||||||
View::show("common/recipe", $recipe);
|
|
||||||
echo '</li>';
|
|
||||||
}
|
|
||||||
echo '</ul>
|
|
||||||
</section></li>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
21
Views/category/view.php
Normal file
21
Views/category/view.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
?>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<?php
|
||||||
|
foreach ($A_view as $categoryName => $recipes) {
|
||||||
|
echo '<li><section>
|
||||||
|
<h1><?$key?></h1>
|
||||||
|
<ul>';
|
||||||
|
foreach ($recipes as $recipe) {
|
||||||
|
echo '<li>';
|
||||||
|
View::show("common/recipe", $recipe);
|
||||||
|
echo '</li>';
|
||||||
|
}
|
||||||
|
echo '</ul>
|
||||||
|
</section></li>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
Loading…
Reference in New Issue
Block a user