X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=d93707fcd26f0c6c52b191687f125f150d1fedb0;hp=b30ecf129e819b80b977af789321db07aaf61c81;hb=8327e2e21fc9ea72c357e876f868001ad9712474;hpb=1a7b17dbf72a1e66e91ccc0c9a139792983564a5 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b30ecf1..d93707f 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -47,7 +47,7 @@ our $DETACH = "catalyst_detach\n"; require Module::Pluggable::Fast; # Helper script generation -our $CATALYST_SCRIPT_GEN = 26; +our $CATALYST_SCRIPT_GEN = 27; __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log dispatcher_class @@ -717,12 +717,15 @@ sub uri_for { $namespace = '' if $path =~ /^\//; $path =~ s/^\///; + my $params = (scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {}); + # join args with '/', or a blank string my $args = ( scalar @args ? '/' . join( '/', @args ) : '' ); $args =~ s/^\/// unless $path; my $res = URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), $base ) ->canonical; + $res->query_form(%$params); $res; }