Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is likely a trivial question, but I am a novice and the answer eludes me. I am using Template Toolkit to process some ... err, templates. Nothing fancy, just passing a reference to a one dimensional hash, the keys match the template variable names, and it spits out exactly what I expect. So on to some more templates, these provided by a 3rd party. I want to use the templates for my output, but the template variable names no longer match my hash keys.
Basically I'm going to be mapping (perhaps not the best word) my hash keys to the 3rd party template variables that are their equivalent. (last_name vs. lname for instance) My question at this time is not related to that particular task, however. My question is....
Does Template Toolkit provide access to the data structure of a parsed template? I already know the names of the keys in my hash, what I want is to be able to fetch out all of the variable names in a simple template and create some logic that can translate my keys to the appropriate template variable.
A nudge in the right direction would suffice. I'm quite sure I am overlooking something obvious.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse template into data structure
by Hofmator (Curate) on Nov 07, 2006 at 09:33 UTC | |
|
Re: Parse template into data structure
by fenLisesi (Priest) on Nov 07, 2006 at 12:35 UTC | |
|
Re: Parse template into data structure
by jbert (Priest) on Nov 07, 2006 at 12:51 UTC | |
|
Re: Parse template into data structure
by Rhandom (Curate) on Nov 07, 2006 at 15:56 UTC | |
by Rhandom (Curate) on Nov 07, 2006 at 16:02 UTC | |
by Anonymous Monk on Nov 07, 2006 at 19:14 UTC |