X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude%2FESI.pm;h=2393c2c9c683c10377a652dcdce843541b1afc45;hb=1113d995f95905c6bd3fec5987c816a21de6657a;hp=1c98d625c39a3f11d314488e94b1298c8bfb06e6;hpb=6cb4b0016e23c2bbd9759aadfd59d00cd35b8ed9;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 1c98d62..2393c2c 100644 --- a/lib/Catalyst/View/Component/SubInclude/ESI.pm +++ b/lib/Catalyst/View/Component/SubInclude/ESI.pm @@ -8,11 +8,11 @@ Catalyst::View::Component::SubInclude::ESI - Edge Side Includes (ESI) plugin for =head1 VERSION -Version 0.02 +Version 0.04 =cut -our $VERSION = '0.02'; +our $VERSION = '0.04'; =head1 SYNOPSIS @@ -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 @@ -53,10 +55,16 @@ common interface for plugins. =cut sub generate_subinclude { - my $class = shift; - my $c = shift; - my $url = $c->uri_for( @_ ); - return ''; + 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 ); + + return ''; } =head1 SEE ALSO