X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude%2FESI.pm;h=635d9789357ee247275a927dbcdb7374da762eae;hb=7ccbc329c8d89fc6e404dddcc85a1ef6eb966431;hp=6d763e1acb9d3564ca5d9a93b80bd0bb94894fbb;hpb=065d5656094bc9b4a8cf3a3466dac7df610d2ecf;p=catagits%2FCatalyst-View-Component-SubInclude.git diff --git a/lib/Catalyst/View/Component/SubInclude/ESI.pm b/lib/Catalyst/View/Component/SubInclude/ESI.pm index 6d763e1..635d978 100644 --- a/lib/Catalyst/View/Component/SubInclude/ESI.pm +++ b/lib/Catalyst/View/Component/SubInclude/ESI.pm @@ -39,11 +39,13 @@ uses of includes. =head1 CLASS METHODS -=head2 C +=head2 C -This will roughly translate to the following code: +Note that C<$path> should be the private action path - translation to the public +path is handled internally. After translation, this will roughly translate to +the following code: - my $url = $c->uri_for( @args ); + my $url = $c->uri_for( $translated_path, @args )->path_query; return ''; Notice that the stash will always be empty. This behavior could be configurable @@ -55,12 +57,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 ''; + return ''; } =head1 SEE ALSO