Let's assume we have the following two Models: CategoryModel (hasMany ProductModel) and a ProductModel.
Now the user navigates to the route /categories
and sees a list of the categories (CategoryController::index()
). The user can now click on a category to see the products in this category.
Would you place this logic into the CategoryController? In a function called details or something similar (CategoryController::details($categoryId)
) or would the logic, to show the products for a category move to a ProductController::index($categoryId)
?