Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - module routing problem
#5

[eluser]Unknown[/eluser]
I'm not sure if this is the correct place to post this, so please let me know.

I want each module to contain it's own routes file, with routes that simplify the module's actual URL.

For example, I have a products module and it contains 2 controllers: cart and catalog.
I can hit the pages for these by going to products/cart/ and products/catalog,
but I'd like to be able to route cart/ to products/cart and catalog/ to products/catalog,
which doesn't work.

Here is the code in application/modules/products/config/routes.php:

Code:
$route['products'] = 'store';

$route['catalog/(:num)/(:num)'] = "catalog/view_product/$1/$2";
$route['catalog/(:num)'] = "catalog/view_product/$1";
$route['catalog/results'] = "catalog/results";
$route['catalog/all'] = "catalog/view_all";

$route['cart'] = "cart/index";
$route['cart/(:any)'] = "cart/$1";

Any advice would be appreciated!


Messages In This Thread
Modular Extensions - module routing problem - by El Forum - 11-11-2010, 03:10 AM
Modular Extensions - module routing problem - by El Forum - 11-11-2010, 03:36 AM
Modular Extensions - module routing problem - by El Forum - 11-11-2010, 03:40 AM
Modular Extensions - module routing problem - by El Forum - 11-11-2010, 03:43 AM
Modular Extensions - module routing problem - by El Forum - 03-31-2011, 11:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB