URI_Helper - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: URI_Helper (/showthread.php?tid=4923) |
URI_Helper - El Forum - 12-24-2007 [eluser]Chris Newton[/eluser] I miss the ease & simplicity of query strings, and I don't like using numbered segments to grab data out of the URI string. I wrote a simple helper to make getting & setting key=>value pairs in the URI using the URI library. http://codeigniter.com/wiki/URI_helper/ URI_Helper - El Forum - 12-24-2007 [eluser]xwero[/eluser] I don't see the benefit of this helper? There are not so many lines in the methods and you are using the CI uri functions. For instance the get_uri method is not more code than Code: $get = $this->uri->uri_to_assoc(3); I also think you can join the set_uri and set_uri_array like other functions of CI Code: function set_uri($data,$value=null) edit : if you have helpers like this you could create an extended CI class in the application/libraries directory so you don't have to autoload it. URI_Helper - El Forum - 12-25-2007 [eluser]Chris Newton[/eluser] As I mentioned in the wiki... it doesn't cut down on too much, but some. It's not unlike some other CI helpers, for instance br(n); which I use all the time from the HTML helper. If it cuts down on a few keystrokes that's what it's designed to do. Don't like it? Don't use it. URI_Helper - El Forum - 12-25-2007 [eluser]sikkle[/eluser] good works. URI_Helper - El Forum - 12-26-2007 [eluser]Chris Newton[/eluser] Oh, and before I forget, I just wanted to thank xwero for the input. The method you describe for set_uri is a good one, and probably better for many people. For my own sake however, I like using 2 different functions for arrays & for single pairs. It may be silly, but it just helps me mentally keep track of what I'm setting. URI_Helper - El Forum - 12-27-2007 [eluser]xwero[/eluser] Nothing is silly we all have are own way of coding. I'm actually beginning to like the get_uri method, i even think about adding it to my MY_URI library. |