URI_Helper |
[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/
[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.
[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.
[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.
[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. |
Welcome Guest, Not a member yet? Register Sign In |