Timothy Appnel wrote:
> But one overriding need I have is to
> allow for a designer who doesn't know Perl (nor
> should they have) to work with the look and feel
> while a developer like myself works on logic and
> implementation. I couldn't find any reference to
> this topic in the archives.
Possibly because this is H::T's main "raison d'etre"?
> I need to provide a designer
> that ability to apply any one or more of a number
> of filters that could occur post processing --
> lowercase, strip tags, encode xml etc. Trying to
> predict and create every possible combination to
> pass into the template seems rather inefficent and
> an exercise in futility.
You could read the list of provided variable names at the start of your
script. If you suffix known names with an agreed set of extensions you
could determine the appropriate processing dynamically.
For example,
USERNAME: username datum "as is"
USERNAME_LC: lowercase the datum
USERNAME_ENCXML: encode xml (or whatever)
I'd suggest some perl like this untested snippet
foreach my $name ($template->query) {
my ($var, @suffices) = split (/_/, $name);
# get the real value for this name
my $value = lookup ($var, 'DEFAULT');
# apply each suffix process in turn
foreach my $suffix (@suffices) {
$value = convert($value, $suffix);
}
}
Regards,
Chris
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users