On Fri, Apr 3, 2009 at 11:20 AM, Ashley Hooper <[email protected]> wrote:

> Hi all,
>
> I've searched the archives (and the net in general) for advice on this, but
> turned up nothing. Is it possible to use a PROCESS directive within a CASE
> clause?
>
> In this example, the template does not render, giving a blank page instead.
> If I remove the PROCESS directive entirely and replace it with raw text the
> template functions.
>
> i.e.
>
> [% SWITCH myswitch;
>      CASE 'yes';
>        [% PROCESS yeserror %]


You're already in a template block, so you don't need the block delimiters
around PROCESS.

[% SWITCH myswitch; CASE 'yes'; PROCESS yeserror; END %]

Be sure to check the return value from $template->process() to know if there
was an error.  I get this error when I try to process your original
template:

file error - parse error - input file handle line 1-3: unexpected token (%)


--Sean
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to