arunhorne has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I want to combine the Template Toolkit with dynamic database lookups
Usual use of the TT is;
This assumes that I know all the variables that need to be defined in the map prior to calling process().
What I would like to do is process a template and when a variable is encountered, lookup it up in a database to find it's value. Now, the first impulse is to just load the map from the database, but I do not know ahead of time what variables will be needed (and the database is huge). So I would like to dynamically look up variables during the process function.
Does anyone know how to do this or something similar with Template Toolkit? Are there better ways to do it?
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template Toolkit and Dynamic Database Lookups
by rinceWind (Monsignor) on Jan 06, 2006 at 15:07 UTC | |
by ikegami (Patriarch) on Jan 06, 2006 at 15:59 UTC | |
by rinceWind (Monsignor) on Jan 06, 2006 at 16:19 UTC | |
|
Re: Template Toolkit and Dynamic Database Lookups
by perrin (Chancellor) on Jan 06, 2006 at 18:43 UTC |