CodeIgniter Forums
alternate uri syntax - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: alternate uri syntax (/showthread.php?tid=15899)



alternate uri syntax - El Forum - 02-18-2009

[eluser]TheFuzzy0ne[/eluser]
Hi everyone. I was thinking about CodeIgniter's uri_to_assoc() function, and I was wondering if anyone agreed with me that segments with the following syntax would be easier to read and maintain:
Code:
http://mysite.tld/controller/method/param1=some_value/param2=some_other_value/

Personally, I think it makes it clearer where the pairs are. Can anyone think of any compelling reason why I should avoid using this method?

Another great thing about this method, is that you could simply iterate through each of the segments, and tell if it's meant to be a pair, so the function wouldn't really have to know where to start creating the key value pairs, and I also believe you're less likely to end up with a busted app because someone inserted a segment somewhere they shouldn't have.

I'd be interested to hear your thoughts.