On Sun, Oct 19, 2003 at 12:53:24PM -0700, Mark Fuller wrote:
>I just found html::template and it's exactly what I was looking for. The
>only thing that is a minor shortcoming for me is the inability to do option
>select lists. I understand the emphasis on keeping a template a template
>(and languages separate). But, here's an example of why I believe it is
>justifiable to provide for an "if" inside the variable loop that would emit
>an option list.

You know, you can do it quite easily without extending HTML::Template.

Here's how I do it. Say I have modes "a", "b" and "c", each of which
will produce different text. (Never mind different languages - I use
this trick for whole different pages in a multiscreen application.) Then
I just turn off die_on_bad_params, and set:

$tmpl->param(mode => $mode,
             "mode.$mode" => 1);

Then the template has:

<tmpl_if name=mode.a>
text for mode A
</tmpl_if>
<tmpl_if name=mode.b>
text for mode B
</tmpl_if>

...and so on. You get the idea...

Roger


-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to