> Andy Wardley wrote:
> * The Template Toolkit is *ONLY* a template system. This is a Good
> Thing. It processes text (HTML, Latex, POD, etc). You can use it
> under Apache/mod_perl, in stand-alone CGI scripts, or in other
> environments entirely unrelated to HTML or the web. This is also
a
> Good Thing.
Form state-maintenance and validation is a grey area. I'd love to
have a TT module that was capable of maintaining form state, and
validating user input. This is an application that doesn't have much
to do with templating per se, but the module would nevertheless need
intimate knowledge of the template internals.
For instance, I would like a backend web application to be able to
learn about form fields from the template tags:
[% input type='text' name='email' required=1
validate_as='email_address' %]
The program then knows that the 'email' field is required. Later on,
a manager can instruct an HTML designer to make the email field
optional. And the backend application doesn't need to be modified at
all. Or, more importantly, retested.
Template::Toolkit v2 does look very interesting, but it look like it
is missing the hooks into the Template structure that a comprehensive
Form module would need. For instance, how would the module gather the
info about a template when it had already been compiled and cached on
disk?
I've been using Text::Boilerplate for years, mainly because it already
had special HTML form field tags. Over time I've added additional
features, like form validation and cacheing (via Files or DBI) the
compiled templates as perl code. Eventually, I'd like to release my
extensions, but I'd be just as happy if the same functionality could
be built in to another system, such as Template::Toolkit.
Michael