Welcome Guest, Not a member yet? Register   Sign In
Routing 2 similar url pattern on different controller
#1

Hi,

i have two groups of urls which should be routed on 2 different controllers. the problem is, they have the same pattern.

Example: new-products and our-products. this is the same pattern [:any]-products, but could this be routed to differnt controllers without hardcoding in the routes.php?
Reply
#2

You should think about having a single products controller, and then using mod_rewrite to rewrite new-products to /products/new and our-products to /products/ours. If the products are coming from different resources, then you'd have more than one product oriented model, pulling in products when you call for them.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB