You are here: Re: [SMARTY] section sum of numbers... « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] section sum of numbers...

Posted by "messju mohr" on 07/20/05 22:21

On Wed, Jul 20, 2005 at 01:54:15PM -0500, Andras Kende wrote:
>
> Hello,
>
> Is there a way to find out the SUM of the numbers from the template ?

it's possible to do this with {assign} and {math}, but it's
recommended to do this kind of logic from php and just assign the
result.

>
> -------------
>
> {section name=i loop=$items}
>   <tr>
>     <td>{$items[i].name}</td>
>     <td>{$items[i].price}</td>
>   </tr>
> {/section}
>
> There items: {$smarty.section.i.total}
> Total price: {$smarty ??? }
>
> -------------
>
> <tr>
> <td>Joe</td>
> <td>2.00</td>
> </tr>
> <tr>
> <td>Steve</td>
> <td>5.00</td>
> </tr>
>
> There items: 2
> Total price: 7.00
>
> -------------
>
> Thanks,
>
> Andras Kende
> http://www.kende.com/
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация