Re: Dumping all vars ?

"Rynhart, Patrick" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Organization Information Technology Services, Massey University
Message-ID <[email protected]>
On 19/04/12 11:32, Patrick Rynhart wrote:
> Is it possible to dump all variables available from within a TT2
> template (or - alternatively - enumerate all variables which are
> available ?)
>
> I've had a look at this:
>
> http://template-toolkit.org/docs/modules/Template/Plugin/Dumper.html
>
> but you need to know the variables previously.
>
> (I'm wanting to list anything which is available from the upstream
> perl script - not variables defined locally in the TT2 script.)
I think this is what I'm after:

    [% USE Dumper %]
    [% FOREACH p = param %]
       [% Dumper.dump(p) %]
    [% END %]

Regards,

Patrick
>
> Thanks,
>
> Patrick
>
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.