X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude%2FESI.pm;h=ba095e996c6d4f8fc07f01ce8f04b4e0739d6ea4;hb=c7c06ff0cc2c5d128d7084843ed96288c76c53d6;hp=1c98d625c39a3f11d314488e94b1298c8bfb06e6;hpb=e88af2835e002b378e700d70a81912b493b40b1f;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..ba095e9 100644 --- a/lib/Catalyst/View/Component/SubInclude/ESI.pm +++ b/lib/Catalyst/View/Component/SubInclude/ESI.pm @@ -1,6 +1,6 @@ package Catalyst::View::Component::SubInclude::ESI; -use warnings; -use strict; +use Moose; +use namespace::clean -except => 'meta'; =head1 NAME @@ -8,11 +8,12 @@ Catalyst::View::Component::SubInclude::ESI - Edge Side Includes (ESI) plugin for =head1 VERSION -Version 0.02 +Version 0.07_03 =cut -our $VERSION = '0.02'; +our $VERSION = '0.07_03'; +$VERSION = eval $VERSION; =head1 SYNOPSIS @@ -37,13 +38,15 @@ Edge Side Includes (ESI) include directives. This is a feature implemented by Varnish (L) which allows cache-efficient uses of includes. -=head1 CLASS METHODS +=head1 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 +56,11 @@ common interface for plugins. =cut sub generate_subinclude { - my $class = shift; - my $c = shift; - my $url = $c->uri_for( @_ ); - return ''; + my ($self, $c, $path, @params) = @_; + + my $uri = $c->uri_for_action( $path, @params ); + + return ''; } =head1 SEE ALSO @@ -84,4 +88,5 @@ under the same terms as Perl itself. =cut +__PACKAGE__->meta->make_immutable; 1;