99designs / ergo

A lightweight php5 library for request/response routing, controllers and http interaction.
http://99designs.com
MIT License
29 stars 4 forks source link

New method to add query parameters to URL #6

Closed mtibben closed 12 years ago

mtibben commented 12 years ago

This method allows query parameters to be merged into the URL.

Is this sane?

harto commented 12 years ago

Did you consider adding something to QueryString?

mtibben commented 12 years ago

hmm I didn't see that.. .

rbone commented 12 years ago

Looks sane in that it follows the conventions established in that class. It would be nice if we could find a way to make it less verbose without sacrificing immutability.

mtibben commented 12 years ago

You're right I could potentially use the QueryString class in getUrlForMergedParameters instead of directly using parse_str / http_build functions

But that means I would need to add a new method to QueryString, as well as Url having a dependency on QueryString.

Do you think it's worth it @harto ?

harto commented 12 years ago

Hmm, I actually thought Url already depended on QueryString.

I do think it's better to encapsulate the calls to parse_str and http_build in one place, and the Url class looks like it's getting a bit hairy.

I'm not too fussed @mtibben, I'll leave it up to you :)