Dave Cash wrote:
> In your template
> (which is process()'ed by render.pl in this example), you want to be
> able to use your plugin as follows:
> 
>   [% USE ValidDate %]
>   [% IF ValidDate.check(date_first_pub) %]
>   date_first_pub is a valid ISO8601 date
>   [% ELSE %]
>   where'd you dig up that funky date format?
>   [% END %]

In addition, you could stick something like this in a PRE_PROCESS template 
to check the date automagically:

preproc:
    [% USE ValidDate;
 
       IF ValidDate.check(template.date_first_pub);
         # OK
       ELSE;
         THROW date "$template.date_first_pub is not a valid ISO8601 date";
       END;
    %]
  
HTH
A


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to