[Catalyst-dev] Patch for Catalyst::uri_for
Erik Broes
erikbroes at ripe.net
Fri May 18 15:45:31 GMT 2007
Hi,
After running into some troubles using $c->uri_for and talking with mst on IRC
I decided to give it a fixing-shot.
Attached is the patch for my finalised version diffed to the current trunk
(6401).
Some notes:
- Rewrote uri_for to do a lot less string-fiddling. It became less
userfriendly but it does what you expect of it.
- Minor pod changes to reflect the changes in the code.
- Fixed bug where a key in the params needing urlencoding would be used after
encoding to look up the value.
- Added test for the calling with a 'C::Action' object + optional argument.
- Added more tests to prove consistency in handling different situations. You
don't end up with an extra '/' before a '?' unless you really intended to.
- The $req->match test was removed because from my pov nothing additional was
tested. If i'm mistaken please put it back in with a comment ^^.
- mst pointed out using calls to URI:: is rather slow so that code should be
inlined. I did not do that so that might need to be done.
Erik Broes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Catalyst-Runtime-uri_for.patch
Type: text/x-diff
Size: 12031 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20070518/602c4ec9/Catalyst-Runtime-uri_for.bin
More information about the Catalyst-dev
mailing list