Just use use_for_action in ESI backend
[catagits/Catalyst-View-Component-SubInclude.git] / lib / Catalyst / View / Component / SubInclude / ESI.pm
index 6b258fb..4ce7799 100644 (file)
@@ -57,12 +57,7 @@ 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) = $dispatcher->_invoke_as_path( $c, $path, $args );
-
-    my $uri = $c->uri_for( $action, $args, @params );
+    my $uri = $c->uri_for_action( $path, @params );
 
     return '<!--esi <esi:include src="' . $uri->path_query . '" /> -->';
 }