Travis Spencer | 17 Apr 21:10
Picon
Gravatar

Passing data to TT2 after FB instantiation but before render

Hey All,

I am constructing FB objects more or less like this:

    my %vars = ( ... );
    my $form = CGI::FormBuilder->new(
        template => {
            type => 'TT2',
            template => $template,
            variable => 'form',
            data => \%vars,
        },
    );

Before calling render, I would like to pass some other variables to
the template.  How can I do this?  How can I access the data hash ref
that will be passed to the Template's constructor or the Template
object itself?

TIA!

--

Regards,

Travis Spencer

Rod McChesney | 17 Apr 21:15
Picon

Re: Passing data to TT2 after FB instantiation but before render

Unless I'm mistaken, if you hold on to the original hash you handed in
(%vars in the example) then you can change its contents at any point
until rendering.  I don't think the TT plugin copies the contents of
that hashref.

Rod

On 4/17/06, Travis Spencer <travislspencer <at> gmail.com> wrote:
> Hey All,
>
> I am constructing FB objects more or less like this:
>
>     my %vars = ( ... );
>     my $form = CGI::FormBuilder->new(
>         template => {
>             type => 'TT2',
>             template => $template,
>             variable => 'form',
>             data => \%vars,
>         },
>     );
>
> Before calling render, I would like to pass some other variables to
> the template.  How can I do this?  How can I access the data hash ref
> that will be passed to the Template's constructor or the Template
> object itself?
>
> TIA!
>
> --
(Continue reading)

Travis Spencer | 17 Apr 22:21
Picon
Gravatar

Re: Passing data to TT2 after FB instantiation but before render

On 4/17/06, Rod McChesney <rod.mcchesney <at> gmail.com> wrote:
> Unless I'm mistaken, if you hold on to the original hash you handed in
> (%vars in the example) then you can change its contents at any point
> until rendering.

You weren't mistaken, Rod.  Thanks.

--

Regards,

Travis Spencer


Gmane