Adding querystrings |
[eluser]mattalexx[/eluser]
The problem with the whole "/controller/action/param1value/param2value/param3value" thing is, the parameters do not have keys and so flexibility is lost (what if I wanted to include param3 but not param1 or param2?). It would be cool if I could do something like this: Code: /controller/action/param1value/param3key:param3value Code: /controller/action/param1value?param3key=param3value
[eluser]Randy Casburn[/eluser]
Have you looked at routing? With the ability to use wildcard routing thus: $route['param3key/:num'] = "yourController/your_param3_method"; $route['param2key/:num'] = "yourController/your_param2_method"; $route['param1key/:num'] = "yourController/your_param1_method"; You can define as many as you need. This provides the flexibility you seek, just with slightly different terminology than you use. I think if you explore this it may work for you. Randy
[eluser]SeanJA[/eluser]
I usually use desc1/param1/desc2/param2 Then I use the uri functions to pull the uri out and just see what is in the uri, then I can expand it without having any big rewrites.
[eluser]Colin Williams[/eluser]
Check out $this->uri->uri_to_assoc(n) at http://ellislab.com/codeigniter/user-gui...s/uri.html
[eluser]mattalexx[/eluser]
[quote author="Colin Williams" date="1214216681"]Check out $this->uri->uri_to_assoc(n) at http://ellislab.com/codeigniter/user-gui...s/uri.html[/quote] That's great. Thanks! |
Welcome Guest, Not a member yet? Register Sign In |