RE: [SMARTY] The infamous loop problem
| From: | Scott Matthewman | Date: | Fri, 22 Nov 2002 14:30:00 +0000 |
| Subject: | RE: [SMARTY] The infamous loop problem | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6509@lists.php.net to get a copy of this message | ||
Have a look at http://smarty.incutio.com/?page=SmartyPlugins
Currently at the bottom of that page are two custom functions that handle
repetition: one which repeats the text of a given parameter a given number
of times, and the second (which I submitted) that implements a block
function to do the same thing.
If anybody has any improvements/optimisations, I'd love to hear them. I'm
using the {repeat}..{/repeat} block fairly extensively on my website, and
I'm always looking at ways to speed things up!
Scott
> -----Original Message-----
> From: Garland Foster [mailto:garland_foster@salutia.com]
> Sent: 22 November 2002 14:18
> To: smarty-general@lists.php.net
> Subject: [SMARTY] The infamous loop problem
>
>
> Hello All,
>
> Please let me know the best approach to this simple problem:
>
> I have "rated" articles in my system and I want to display "n" stars
> depending on the rating. For example if rating=5 I want to
> display 5 stars.
> The stars are simple images star.gif
> How can I do this, assuming I have $rating as a template variable?
> Is there a way to loop from 1 to $rating ?
>
> Thanks a lot.
> Garland
>
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>