Re: [SMARTY] The infamous loop problem
| From: | Monte Ohrt | Date: | Fri, 22 Nov 2002 14:30:21 +0000 |
| Subject: | Re: [SMARTY] The infamous loop problem | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6510@lists.php.net to get a copy of this message | ||
{section loop=$rating}
<img src="star.gif">
{/section}
On Fri, 2002-11-22 at 08:18, Garland Foster wrote:
> 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
>
--
Monte Ohrt <monte@ispi.net>