Re: feature request

From: Date: Fri, 14 Dec 2001 14:25:38 +0000
Subject: Re: feature request
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2294@lists.php.net to get a copy of this message
So you're suggesting that math operations should be part of the template language, and not a function call. Thoughts? Ivo Jansch wrote: > > Hi, > > remember the thread where we discussed that Smarty should make layout > things as simple as possible? I have a related feature request: > > Goal: a loop with spacer images, where the spacing decreases 5 pixels on > each loop iteration. > > Current Smarty solution: > > {section name=loop loop=$items} > <br><img src="img/spacer.gif" > width="{math equation="100-(5*x)" x=%loop.index%}> > {$items[loop]} > {/section} > > Current PHP solution: > > for ($i=0;$i<count($items);$i++) > { > echo '<br><img src="img/spacer.gif" > width="'.(100-(5*$i)).'">'.$items[$i]; > } > > Requested Smarty solution: > {section name=loop loop=$items} > <br><img src="img/spacer.gif" > width="{100-(5*%loop.index%)}">{$items[loop]} > {/section} > > In other words, would it be possible to make the math routines easier to > use? Maybe with a special {} thingee, like starting with {= instead of {$. > > Greetings, > Ivo > > -- > Ivo Jansch <ivo@ibuildings.nl> > ibuildings.nl BV - information technology > http://www.ibuildings.nl > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.smarty.general (#2294) next »