Re: [SMARTY] The infamous loop problem

From: Date: Fri, 22 Nov 2002 23:04:15 +0000
Subject: Re: [SMARTY] The infamous loop problem
References: 1 2 3 4 5 6  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6523@lists.php.net to get a copy of this message
Yeah add the name parameter even though you don't use it in this case. As long as $rating is an integer, it should work. $smarty->assign('rating',5); On Fri, 2002-11-22 at 08:52, Garland Foster wrote: > Does this really work? > Adding the missing "name" parameter > I can't get the section to do the loop > > ----- Original Message ----- > From: "Monte Ohrt" <monte@ispi.net> > To: "Garland Foster" <garland_foster@salutia.com> > Cc: <smarty-general@lists.php.net> > Sent: Friday, November 22, 2002 11:30 AM > Subject: Re: [SMARTY] The infamous loop problem > > > > {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> > > > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.general (#6523) next »