Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsonsfj committed Feb 6, 2009
1 parent 9831b6d commit 3f21aac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
8 changes: 5 additions & 3 deletions lib/Catalyst/View/Component/SubInclude/ESI.pm
Expand Up @@ -39,11 +39,13 @@ uses of includes.
=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
Expand Down
10 changes: 7 additions & 3 deletions lib/Catalyst/View/Component/SubInclude/SubRequest.pm
Expand Up @@ -55,13 +55,17 @@ It requires L<Catalyst::Plugin::SubRequest>.
=head2 C<generate_subinclude( $c, $path, @args )>
This will translate to the following sub-request call:
This will make a sub-request call to the action specified by C<$path>. Note that
C<$path> should be the private action path - translation to the public path is
handled internally.
$c->sub_request( $path, {}, @args );
So, after path translation, the call will be (roughly) equivalent to:
$c->sub_request( $translated_path, {}, @args );
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
common interface for plugins.
common interface for all plugins.
=cut

Expand Down
10 changes: 9 additions & 1 deletion lib/Catalyst/View/Component/SubInclude/Visit.pm
Expand Up @@ -40,14 +40,22 @@ render subinclude contents.
This method is only supported when using L<Catalyst> version 5.71000 or newer.
B<WARNING: As of Catalyst version 5.71000, this plugin doesn't work for chained
actions with captured arguments>. Apparently, C<visit> doesn't handle this type
of actions yet.
=head1 CLASS METHODS
=head2 C<generate_subinclude( $c, $path, @args )>
This will translate to the following call:
This is (roughly) equivalent to the following call:
$c->visit( $path, @args );
But it will handle all the nasty details such as localizing the stash,
parameters and response body. This is necessary to keep behavior consistent
with the other plugins.
=cut

sub generate_subinclude {
Expand Down

0 comments on commit 3f21aac

Please sign in to comment.