Re-mapping URI segments when using sub-folders in /controllers |
[eluser]Matthew Pennell[/eluser]
I'm using a sub-folder for my controllers, so I can do: http://www.example.com/sub-folder/controller/method/id However, this means that the id passed through above is in $this->uri->segment(4) instead of segment 3 where it normally would be. Is there any way to either: a) Re-map the URI segments so 4 is 3 and so on; or b) Use the routes.php re-mapping rules to map requests onto controllers in sub-folders while retaining the correct numbering of URI segments? ![]()
[eluser]alpar[/eluser]
i add parameters to the controllers methods. Code: function method($param='') and for an uri like /folder/controler/method/value od /controller/method/value value gets passed to the function as $param and i think this is a bullet proof method when using routs.php too!
[eluser]Matthew Pennell[/eluser]
Ah, excellent - I'd overlooked that way of retrieving parameters. Thanks. ![]()
[eluser]Phil Sturgeon[/eluser]
Also remember to take advantage of Code: echo $this->uri->router->directory; |
Welcome Guest, Not a member yet? Register Sign In |