[Templates] Alternative to IF / ELSE's ?

Andy Wardley abw@andywardley.com
Thu, 14 Nov 2002 13:08:26 +0000


On Thu, Nov 14, 2002 at 11:29:58AM +0000, Leo Lapworth wrote:
> 0 -> 200,000
> 200,000 -> 300,000
> 300,000 -> 400,000
> ...
> 2,000,000 +

[...]

> the HTML person should be responsible for this rather than the perl guys.

You could write a Perl function which implements the logic, but takes
arguments from the caller.  Something like this perhaps:

  [% limits = inrange( price, 0, 200000, 300000, 400000, ..., 9999999 ) %]

A