Welcome Guest, Not a member yet? Register   Sign In
issues with Routing
#1

[eluser]Unknown[/eluser]
Happy New Year everyone!

OK so I am sure my problem is easily resolved, but it isn't obvious to me so maybe one of you experts can help.

I have a controller called products, with a bunch of methods, index shows all products by category, there is a method azproducts does the same thing but groups by letter, then i have a search method also. then each product has its individual view in the view method.

here are my routes:

$route['products'] = 'products';
$route['products/addtobasket/(:any)'] = 'products/addtobasket/$1';
$route['products/view/(:any)'] = 'products/view/$1';
$route['products/azproducts/(:any)'] = 'products/azproducts/$1';
$route['products/search/(:any)'] = 'products/search/$1';
$route['products/(:any)'] = 'products/index/$1';

Now I think the issue is to do with the bottom line, as if I remove 'index' from $route['products/(:any)'] = 'products/index/$1' it returns with a 404, but if i leave it in, it works. However with it left in, the search page then fails to work and routes to the index method instead. does anyone have any ideas what I am doing wrong?


Messages In This Thread
issues with Routing - by El Forum - 01-02-2013, 02:51 AM
issues with Routing - by El Forum - 01-02-2013, 07:42 PM
issues with Routing - by El Forum - 01-03-2013, 01:36 AM
issues with Routing - by El Forum - 01-03-2013, 07:02 AM
issues with Routing - by El Forum - 01-03-2013, 10:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB