[Catalyst-commits] r11446 - Catalyst-View-TT/trunk/lib/Catalyst/View

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun Oct 4 00:07:00 GMT 2009


Author: t0m
Date: 2009-10-04 00:06:59 +0000 (Sun, 04 Oct 2009)
New Revision: 11446

Modified:
   Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm
Log:
Note using forward to call the view both process and render methods

Modified: Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm
===================================================================
--- Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm	2009-10-04 00:01:16 UTC (rev 11445)
+++ Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm	2009-10-04 00:06:59 UTC (rev 11446)
@@ -478,14 +478,19 @@
 The constructor for the TT view. Sets up the template provider,
 and reads the application config.
 
-=head2 process
+=head2 process($c)
 
 Renders the template specified in C<< $c->stash->{template} >> or
 C<< $c->action >> (the private name of the matched action).  Calls L<render> to
 perform actual rendering. Output is stored in C<< $c->response->body >>.
 
-FIXME: NOTE forward here
+It is possible to forward to the process method of a TT view from inside
+Catalyst like this:
 
+    $c->forward('View::TT');
+
+N.B. This is usually done automatically by L<Catalyst::Action::RenderView>.
+
 =head2 render($c, $template, \%args)
 
 Renders the given template and returns output, or a L<Template::Exception>
@@ -506,8 +511,11 @@
 To use the render method outside of your Catalyst app, just pass a undef context. 
 This can be useful for tests, for instance.
 
-FIXME: NOTE forward here
+It is possible to forward to the render method of a TT view from inside Catalyst
+to render page fragments like this:
 
+    my $fragment = $c->forward("View::TT", "render", $template_name, $c->stash->{fragment_data});
+
 =head2 template_vars
 
 Returns a list of keys/values to be used as the catalyst variables in the




More information about the Catalyst-commits mailing list