Re: A bug in section loop

From: Date: Tue, 17 Jul 2001 14:24:44 +0000
Subject: Re: A bug in section loop
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1182@lists.php.net to get a copy of this message
how about array_values()? At 15:19 7/17/2001, Andrei Zmievski wrote the following: -------------------------------------------------------------- >On Tue, 17 Jul 2001, Ivo Jansch wrote: >> Would it not be nice if you could support non contiguous arrays as well? >> It's quite easy. You just have to change your loop a bit. >> >> Instead of a 'normal' loop, like >> >> for($i=0;$i<count($array);$i++) >> { >> echo $array[$i]; >> } >> >> you could do: >> >> foreach($array as $key => $value) >> >> { >> echo $value; >> } >> >> This way you could even loop associative arrays.. > >Trust me, if it were that easy, I would have already done it. ;-) The >problem is that with foreach() approach you are limited to looping >through only one array, whereas {section} needs to support looping >through several. Having said that, I'm still thinking about how to make >it work. > >-Andrei > >The Heineken Uncertainty Principle: > You can never be sure how many beers you had last night. > >--- >You are currently subscribed to smarty as: cynic@mail.cz >To unsubscribe send a blank email to $subst('Email.Unsub') >Visit Smarty's homepage at >http://www.phpinsider.com/php/code/Smarty/ ------end of quote------ cynic@mail.cz ------------- And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7

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