Routes problem |
[eluser]haxxorized[/eluser]
Hey, I have a little problem... Say, if I wanted to go to a link: for example: www.example.com/link that would trigger the index function of the 'link' controller, but say if I wanted to trigger a different function with this link, let's say 'function2' then I could go to the config file and add to the routes array: $routes['link'] = 'link/function2'; So that's all OK, but now I want some parameters to add to that function, and the parameters come from the link... how do I do that?
[eluser]Rob Gordijn[/eluser]
ok, a fast reply: Code: class Link { now call example.com/link/function2/foo/bar
[eluser]Jeremy Gimbel - Conflux Group[/eluser]
You might actually have to add something to your route: Code: $routes[‘link/(:any)’] = ‘link/function2/$1’; Keep in mind that'll kill all the default routing to methods, and you'll need to create routes for each other method. |
Welcome Guest, Not a member yet? Register Sign In |