[Catalyst] Forward to view question

Andrew Rodland arodland at comcast.net
Wed May 6 21:28:10 GMT 2009


On Wednesday 06 May 2009 09:01:43 am Dennis Daupert wrote:
> On Tue, May 5, 2009 at 7:24 PM, Tomas Doran <bobtfish at bobtfish.net> wrote:
> > my $output = delete $c->res->{body};
> > opem(FH, ">file") or die;
> > print FH $output;
> > close(FH);
> >
> > will do what you want...

> There are some things that aren't so obvious to me. Where would I place the
> code represented in your snippet?  I can't just hang it out in the main
> body of package hde::View::TTprint, 

In that example you don't *have* a View::TTprint. Or if you do, it's just 
another subclas of C::V::TT with a different config and search path. No 
overloading, no OUTPUT. You forward to the view, it writes into $c->res->body 
like it always does. You take the data out of $c->res->body and write it to a 
file, then null out $c->res->body so that RenderView will fill it in later 
using your default_view.

Andrew




More information about the Catalyst mailing list