[Templates] Can TT throw an error if a key doesn't exist in stash?
Hugh Hunter
hhunter at cheetahmail.com
Thu May 22 18:19:41 BST 2008
Hello all,
I am using TT to process templates of some XML configuration files. I'm
curious as to whether you can override the standard TT behavior of
substituting an empty string for a key that isn't in stash.
eg.
"This is some [% foo %] text."
becomes
"This is some text." if foo is not a key in the stash.
While this behavior is acceptable (even desirable) for processing an
HTML template or something of the kind, I'd rather have the call to
Template::process fail if the input file contains a reference to a key
that doesn't exist in the stash.
Short of wrapping some sort of EXISTS functionality around each variable
in my template, I'm at a loss.
Any ideas / thoughts are much appreciated.
--Hugh
--
Hugh Hunter
Software Engineer
Experian CheetahMail
More information about the templates
mailing list