* raptor ([EMAIL PROTECTED]) [011017 04:21]:
> hi,
>
> I have a common layout but want to place different text depending on the
> content of variable i.e.:
>
> <? IF checkvar == 'blah' ?>
> <td>Blah text :</td><td><? var1 ?></td>
> <? END ?>
>
> <? IF checkvar == 'hoho' ?>
> <td>Hoho text :</td><td><? var1 ?></td>
> <? END ?>
>
> .....
> <? IF checkvar == 'eho' ?>
> <td>Eho text :</td><td><? var1 ?></td>
> <? END ?>
>
> It is a little bit more complex, but U get the idea, Depending on
> 'checkvar' text is different but variables stays the same... (Using
> IF's in this seems very ugly ) Probably some combination of WRAP and
> BLOCK, but still can;t figure out !!!
Maybe it's too complicated for this, but creating a hash with your
'checkvar' as the key and the text as the value would seem to be the
easiest way to do this:
<? showtext = { blah = 'Blah text', hoho = 'Hoho text', ... } ?>
<td><? showtext.$checkvar ?></td><td><? var1 ?></td>
Chris
--
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.