From: Tomas Doran Date: Sun, 4 Oct 2009 00:06:59 +0000 (+0000) Subject: Note using forward to call the view both process and render methods X-Git-Tag: v0.33^2~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-TT.git;a=commitdiff_plain;h=0deea661d435742e001df024796ef6e4a861a2c6 Note using forward to call the view both process and render methods --- diff --git a/trunk/lib/Catalyst/View/TT.pm b/trunk/lib/Catalyst/View/TT.pm index dd5710e..2d19a47 100644 --- a/trunk/lib/Catalyst/View/TT.pm +++ b/trunk/lib/Catalyst/View/TT.pm @@ -478,13 +478,18 @@ See L> property of the L method. 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 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. =head2 render($c, $template, \%args) @@ -506,7 +511,10 @@ See L for a full list of supported formats. 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