=head1 VERSION
-Version 0.02
+Version 0.05
=cut
-our $VERSION = '0.02';
+our $VERSION = '0.05';
=head1 SYNOPSIS
=head1 CLASS METHODS
-=head2 C<generate_subinclude( $c, @args )>
+=head2 C<generate_subinclude( $c, $path, @args )>
-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 '<!--esi <esi:include src="$url" /> -->';
Notice that the stash will always be empty. This behavior could be configurable
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 '<!--esi <esi:include src="' . $uri->path . '" /> -->';
+ return '<!--esi <esi:include src="' . $uri->path_query . '" /> -->';
}
=head1 SEE ALSO