Fix everything but visit is broken
[catagits/Catalyst-View-Component-SubInclude.git] / lib / Catalyst / View / Component / SubInclude / ESI.pm
index 6d763e1..e8f446f 100644 (file)
@@ -55,12 +55,14 @@ common interface for plugins.
 sub generate_subinclude {
     my ($class, $c, $path, @params) = @_;
 
+    my $args = ref $params[0] eq 'ARRAY' ? shift @params : [];
+    
     my $dispatcher = $c->dispatcher;
-    my ($action, $args) = $dispatcher->_invoke_as_path( $c, $path, @params );
+    my ($action) = $dispatcher->_invoke_as_path( $c, $path, $args );
 
-    my $uri = $c->uri_for( $action, $args );
+    my $uri = $c->uri_for( $action, $args, @params );
 
-    return '<!--esi <esi:include src="' . $uri->path . '" /> -->';
+    return '<!--esi <esi:include src="' . $uri->path_query . '" /> -->';
 }
 
 =head1 SEE ALSO