X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-Component-SubInclude.git;a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude%2FSubRequest.pm;h=3a5658a446aed37ae5c97c591255215188f374f4;hp=4b997c0f427c473a7b354d800240be8ef6a46795;hb=9c2c47b0e815f4d60ea7d51ebd0b584ec84ae2f6;hpb=9208158e8310a611cd47ef9b7c0f66e50c6f9df2 diff --git a/lib/Catalyst/View/Component/SubInclude/SubRequest.pm b/lib/Catalyst/View/Component/SubInclude/SubRequest.pm index 4b997c0..3a5658a 100644 --- a/lib/Catalyst/View/Component/SubInclude/SubRequest.pm +++ b/lib/Catalyst/View/Component/SubInclude/SubRequest.pm @@ -76,14 +76,15 @@ sub generate_subinclude { croak "subincludes through subrequests require Catalyst::Plugin::SubRequest" unless $c->can('sub_request'); - my $args = ref $params[0] eq 'ARRAY' ? shift @params : []; + my $args = ref $params[0] eq 'ARRAY' ? shift @params : []; + my $query = ref $params[-1] eq 'HASH' ? pop @params : {}; my $dispatcher = $c->dispatcher; my ($action) = $dispatcher->_invoke_as_path( $c, $path, $args ); my $uri = $c->uri_for( $action, $args, @params ); - $c->sub_request( $uri->path, $stash, @params ); + $c->sub_request( $uri->path, $stash, $query ); } =head1 SEE ALSO