Welcome Guest, Not a member yet? Register   Sign In
complex routing with nested url
#1

[eluser]Unknown[/eluser]
I have a question about how to set up my routing for an application i am building.

I have a few normal controllers which work:

Code:
/users
/pages
/etc

Now i want to make a somewhat nested structure in my application

Code:
/brand
/brand/project
/brand/project/folder

each of these steps should have its own controller where certain methodes can be called like:

Code:
/brand/project/add (load project controller)
/brand/project/edit/12 (load project controller)
/brand/project/folder/delete/56 (load folder controller)

However i have no idea how to make this work with the routes.php function.

I tried this, however this was for the following url structure

Code:
/brands/1/projects/1375/folders

Code:
$route['brands/(:num)/projects/(:num)/folders'] = "folders";
$route['brands/(:num)/projects/(:num)'] = "folders";
$route['brands/(:num)/projects'] = "projects";
$route['brands/(:num)'] = "projects";
$route['brands'] = "brands";

But i couldnt call for example an add function in the projects controller.

Can anyone give me a kick in the right direction?




Theme © iAndrew 2016 - Forum software by © MyBB