• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routing 2 similar url pattern on different controller


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?

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.