How to retrieve a variable from URL before the controller? |
[eluser]falmp[/eluser]
My application will run for several users. So for instance, I have the controller bike. I can view/add/delete/update bikes by accessing the URLs: /bike/view /bike/add /bike/delete /bike/update Now, I want each user can access this controller by these URLs: /bill/bike/view /bill/bike/add /bill/bike/delete /bill/bike/update /john/bike/view /john/bike/add /john/bike/delete /john/bike/update I know that my whole application will always be accessed by a context (/user/). But I don't know what more segments I'll have on my URI. How can I get this variable? I was thinking in using routes, but I'm not sure it'd work or if it's the best solution: Code: $route[':any/(:any)'] = '$1'; Is this the best solution? Ideas?
[eluser]gyo[/eluser]
You could give a look to "Hooks" in the user guide: http://ellislab.com/codeigniter/user-gui...hooks.html Hope it helps. gyo
[eluser]falmp[/eluser]
[quote author="xwero" date="1236557074"]http://ellislab.com/forums/viewreply/543955/[/quote] Ok, good, it's the same solution I came up. Guess it's the way to do it. Thanks! |
Welcome Guest, Not a member yet? Register Sign In |