The infamous loop problem
| From: | Garland Foster | Date: | Fri, 22 Nov 2002 14:18:08 +0000 |
| Subject: | The infamous loop problem | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6506@lists.php.net to get a copy of this message | ||
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