[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Global vars management in templates


> I know you are looking for AnyTemplate answers, but I thought I would
> mention how this is done with the TT plugin.  Everytime you call
> tt_process to render a template, an automatic call is made to
> tt_pre_process
...
> I believe there is similar functionality in AnyTemplate, but I don't
> know the exact syntax...  Check the docs

Yeah, it's similar in AnyTemplate:

    $self->add_callback('template_pre_process', \&add_my_globals);

    sub add_my_globals {
        my ($self, $template) = @_;

        $template->param('foo' => 'bar');
        $template->param('bam' => 'boom');
    }


Michael


---
Michael Graham <suppressed>



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.