feature request
| From: | Ivo Jansch | Date: | Fri, 14 Dec 2001 11:01:12 +0000 |
| Subject: | feature request | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2290@lists.php.net to get a copy of this message | ||
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