X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude%2FESI.pm;h=85acbdd620cb8f21f13720c22b415cbc53d84868;hb=bff1b853c17ad52e468fe8984ab3b18964463c7f;hp=f2b499aba4384d983ef3c6434b271ac6fdce2f61;hpb=4e3277560cc20740e2cdb58f4f9cf8eda74c9d73;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 f2b499a..85acbdd 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.01
+Version 0.07_03
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.07_03';
+$VERSION = eval $VERSION;
=head1 SYNOPSIS
@@ -37,14 +38,16 @@ Edge Side Includes (ESI) include directives. This is a feature implemented by
Varnish (L) which allows cache-efficient
uses of includes.
-=head1 STASH FUNCTION
+=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
in the future through an additional switch - for now, this behavior guarantees a
@@ -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;