I want to route multiple controllers.
I do have the following construct:
Controllers: app_cart , cart , app_categories , categories , etc
I want to route to the app_cart controller if the url is like this:
url.com/app/cart
and to cart when url is like this:
url.com/cart (thats what codeigniter does on his own!)
Any solutions? I dont want to route every single funtion and param! :/
EDIT:
I found a solution:
$route['app/(:any)'] = 'app_$1';
Hope this will help somebody! ;)
Apply this in your
application/config/routes.php
For Controller: app_cart
For Controller: app_categories
Note: The above settings point your
index
function/method for your controllers because still you are not mention function/method name in the urlIf you want to point specific function/method for your controllers, then you should mention the name in URL. Below is a sample configuration
For Controller: app_cart/view
For Controller: app_categories/view
Note:
view
is a function/method name for your controllers