Welcome Guest, Not a member yet? Register   Sign In
How to create URL like "" www.domain.com/products/blue-shirts "" ?
#5

[eluser]CroNiX[/eluser]
Code:
$route['products/(:any)' = 'products/view/$1';
$route['products'] = 'products/view_all';  //If there was no product passed, it will call this "view_all" method where you can list all products

Routes with the most segments need to come before those with fewer, like above. First route has 2 segments, "products/some-product" and the 2nd one only has 1, "products". So it should go in that order or the routing won't work properly.


Messages In This Thread
How to create URL like "" www.domain.com/products/blue-shirts "" ? - by El Forum - 12-11-2013, 12:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB