[Catalyst] sending a variable to more than one tt2 template

Jonathan Rockway jon at jrock.us
Fri Mar 7 18:14:29 GMT 2008


* On Thu, Mar 06 2008, Eden Cardim wrote:
> On Thu, Mar 6, 2008 at 7:36 PM, Emily Heureux <emily at burnham.org> wrote:
>> Hi, I have a variable in a Controller method sent to the stash for a
>> particular tt file.  What if I want that same variable to be available to
>> another tt file?  I assume I cannot set two templates in one method.
>
> yeah you can:
>
> my $vars = { foo => 'bar' };
> my $output1 = $c->view('TT')->render($c, 'template1.tt', $vars);
> my $output2 = $c->view('TT')->render($c, 'template2.tt', $vars);

The problem with this is "and then what?"  I think the original poster
really just wants to [% INCLUDE %] things.

Regards,
Jonathan Rockway



More information about the Catalyst mailing list