I've created a view that's intended to write a couple of files to the file system. <br><br>The output filename needs to be dynamically set. I'm having a bit of a go figuring out how to do that.<br><br>The TT configuration documentation speaks of an output subroutine:<br>
<br><div style="margin-left: 40px;">OUTPUT => \&output,<br><br></div>Later on in the view base class...<br><br>sub output {<br> my $filename = shift;<br> # do stuff<br>}<br><br>Here's my question:<br>How do I get the $filename into sub output when I forward to the view? <br>
<br><br>Here is my view class configuration:<br><br>package hde::View::TTprint;<br><br>use strict;<br>use base 'Catalyst::View::TT';<br><br>__PACKAGE__->config({<br> TEMPLATE_EXTENSION => '.tt2', <br>
INCLUDE_PATH => [<br> hde->path_to( 'root', 'src' ),<br> hde->path_to( 'root', 'lib' ),<br> hde->path_to( 'root', 'tt2' )<br> ],<br> PRE_PROCESS => 'config/main',<br>
WRAPPER => 'site/wrapper',<br> OUTPUT => \&output,<br> OUTPUT_PATH => [<br> hde->path_to( 'root', 'static', 'published' ),<br> ],<br> ERROR => 'error.tt2',<br>
TIMER => 0<br>});<br><br>/dennis<br>