Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Getting all used parameters from a Template::Toolkit template

by assemble (Friar)
on Mar 11, 2009 at 13:29 UTC ( #749865=note: print w/ replies, xml ) Need Help??


in reply to Getting all used parameters from a Template::Toolkit template

Update: I just re-read the post and realized this isn't what you would want, nevermind

Another option is to shove all of your form values into a hashref and send that to TT, like this:

my $form_fields = { user_name => 'username', user_pass => 'userpass', other_field => 'value', };

Later on, pass this into TT as a var named 'form' or something like that. Your template code would be something like:

[% FOREACH field IN form %] [% field.key %]: [% field.value %] [% END %]


Comment on Re: Getting all used parameters from a Template::Toolkit template
Select or Download Code
Re^2: Getting all used parameters from a Template::Toolkit template
by Corion (Pope) on Mar 11, 2009 at 13:32 UTC

    And how would this solution know that the template has used user_name already and not output it?

      I missed that part of the original post--it wouldn't help with what you want. Oops

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://749865]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-08-21 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls