Just use use_for_action in ESI backend
Tomas Doran [Sun, 24 Jan 2010 22:27:15 +0000 (22:27 +0000)]
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 . '" /> -->';
 }