Re: Section loops
| From: | Andrei Zmievski | Date: | Sat, 27 Jan 2001 05:55:52 +0000 |
| Subject: | Re: Section loops | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11@lists.php.net to get a copy of this message | ||
At 08:03 PM 1/26/01 -0500, August Zajonc wrote:
Had some quick questions on section loops. lets say my template is simply: Start {$i} End and I want $i to run from one to one hundred. In phplib the solution is to have a block, and loop through appending with new $i's It appears to me that Smarty requires one to build up the complete array beforehand, and then assign it, and that append applies to a differant case. Is this correct?Yes. The template engine I wrote before Smarty used the same approach as PHPLIB and FastTemplate - assigning variables to template and then parsing the dynamic blocks. I did not really like that approach because it resulted, at least for us, in a lot of overhead when programming scripts and also made it kind of confusing for designers because they could not freely move dynamic blocks around without knowing which ones would be parsed and when and how. -Andrei