in reply to Testing Template, or should I write a diff for TT templates?
I was actually thinking about this problem this morning (though with regard to HTML::Template, though it should be possible to generalize it to any template system).
The problem with keeping two sets of templates (production and debugging) is that a change in the variables sent means you have to update both templates. Ick.
Instead, the template module should take a 'debug' option. When activated, the template system will still open the template files and parse them (thus allowing things like HTML::Template's strict mode to work). However, instead of outputing the filled-in template, the system outputs a plaintext version containing the data structure that would otherwise be used to fill-in the template, and is thus easy to parse. Simply dumping with Data::Dumper would be OK (though that would make it harder to parse with anything except Perl). YAML would be a better choice.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Testing Template, or should I write a diff for TT templates?
by EvdB (Deacon) on Nov 14, 2003 at 18:11 UTC | |
by iburrell (Chaplain) on Nov 14, 2003 at 20:18 UTC | |
by hardburn (Abbot) on Nov 14, 2003 at 18:36 UTC |